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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:d497ded4fb603b0494b7ede96dd983be9c3cacf1

commit r16-8071-gd497ded4fb603b0494b7ede96dd983be9c3cacf1
Author: Jakub Jelinek <[email protected]>
Date:   Fri Mar 13 09:13:09 2026 +0100

    c++: Fix up *display_string_of on anon union member [PR124388]

    {,u8}display_string_of was printing any unnamed FIELD_DECL as
    %T::<unnamed bit-field>, but anon union member is also unnamed and
    is not a bit-field.

    Fixed by printing %T::<anonymous union> for anon union NSDM and
    %T::<unnamed member> for anything else unnamed (e.g. anon struct NSDM).

    2026-03-13  Jakub Jelinek  <[email protected]>

            PR c++/124388
            * reflect.cc (eval_display_string_of): Only print <unnmamed
bit-field>
            for DECL_UNNAMED_BIT_FIELD, for anon union print <anonymous union>,
            otherwise print <unnamed member>.

            * g++.dg/reflect/display_string_of1.C (S, NS5::S): Add
            union { int a; }.  Add static_assertions that the unnamed
non-static
            data member is printed as <unnamed member>.
            * g++.dg/reflect/u8display_string_of1.C (S, NS5::S): Add
            union { int a; }.  Add static_assertions that the unnamed
non-static
            data member is printed as <unnamed member>.

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to