Skip to content

clang-19 returns true for __is_literal_type on union with non trivial member starting with C++-23 #85550

@AMS21

Description

@AMS21

Given the following code

struct non_trivial {
    ~non_trivial();
};

union non_trivial_union {
    int i;
    non_trivial n;
};

static_assert(!__is_literal_type(non_trivial), "");
static_assert(!__is_literal_type(non_trivial_union), "");

clang-18.1.0 compiles fine while clang-19 fails the second static_assert.

godbolt

Note that this does not happen in C++-20 mode godbolt

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions