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

--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Patrick Palka
<[email protected]>:

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

commit r16-8841-gfd65d688f7a701c3665334402329b4e05cbf6616
Author: Patrick Palka <[email protected]>
Date:   Wed Apr 29 08:48:31 2026 -0400

    c++/modules+reflection: fix merging typedef struct { } A [PR124582]

    r16-7903 changed the representation of typedefs to an unnamed type, such
    as typedef struct { } A, so that we preserve both the unnamed and typedef
    TYPE_DECL rather than replacing the unnamed decl.  This patch teaches
    modules declaration merging to handle the new representation when streaming
    in the unnamed decl, working around the fact that the unnamed decl isn't
    visible to name lookup but still has the same DECL_NAME as the typedef
decl.

            PR c++/124582
            PR c++/123810

    gcc/cp/ChangeLog:

            * module.cc (check_mergeable_decl) <case TYPE_DECL>: Handle
            merging a typedef to an unnamed type with the -freflection
            representation.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/anon-4.h: New test.
            * g++.dg/modules/anon-4_a.H: New test.
            * g++.dg/modules/anon-4_b.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>
    (cherry picked from commit 7802275c29d3c301c6f168ef1098a38494a0e836)

Reply via email to