https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94066

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
clang++ diagnostics is
assignment to member 'y' of union with active member 'a' is not allowed in a
constant expression
Note, in C++17 things are clear and we shouldn't reject all changes of union
active member, there is diagnostics for that e.g. since PR89336 (though unsure,
do we need to mark the member as active as soon as we start evaluating its
NSDMI?), but C++20 dropped the requirement that in constant expressions the
active member can't be changed, so what exactly is the basis of this being
invalid?

Reply via email to