[Bug c++/122994] [Modules] lambda expression in global variable initializer is considered to expose TU-local types

nshead at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 4 10:55:33 GMT 2025


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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2025-12-04
           Assignee|unassigned at gcc dot gnu.org      |nshead at gcc dot gnu.org
                 CC|                            |nshead at gcc dot gnu.org

--- Comment #2 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed.  The issue is that we treat the lambda as a separate declaration and
so don't see that its body is within a variable initializer.

Really we should not be streaming the initializer of the variable or the lambda
within it at all, I don't think.


More information about the Gcc-bugs mailing list