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

            Bug ID: 120676
           Summary: Internal compiler error: in push_namespace (in modules
                    app)
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: admin at hexadigm dot com
  Target Milestone: ---

Hi there,

I'm the author of this repository
https://github.com/HexadigmSystems/FunctionTraits. The non-module (pure ".h")
version compiles fine in the latest version of GCC (15.1) but the module
version fails with a number of errors including an "internal compiler error".
It's therefore unclear if the latter error is triggering the former. The same
code compiles fine in both Clang and MSVC however so I'm going on the
assumption (for now) that it is presumably a GCC bug. Note that I'm a very
experienced C++ developer FWIW but modules are still quite new to most of
course so hopefully it's not something I'm doing wrong (but not that I can tell
- mea culpa otherwise, hopefully I'm not wasting your time).

Note that I'm not a GCC developer (I normally work in the Windows world) so I'm
relying on Compiler Explorer to test the code which relies on standard C++
only. For some unknown reason however Compiler Explorer always times out when I
try to compile the module version for "x86-64 gcc 15.1" (maybe you'll have
better luck) but doesn't time out when compiling for "x86-64 gcc 15.1
(assertions)" (go figure) or even "x86-64 gcc (trunk)". In the latter two cases
you can therefore see the errors which seem to be the same (or very close) in
both versions.

Here's a link to the code set to use "x86-64 gcc (trunk)":

https://godbolt.org/z/GevKcf37o

It fails as described above but succeeds in Clang as seen in the window on the
right (MSVC also succeeds though that's not directly testable in Compiler
Explorer due to limitations it has with MSVC apps). Note that the above link
compiles the module version of the app. If you wish to compile the non-module
(purely ".h") version for some reason (if only to confirm that it does compile
for GCC), then simply do the following and recompile:

Remove the "-DSTDEXT_USE_MODULES=" option (switch) seen in the build options
(switches) near the top left-left corner (just above where you see
"FunctionTraitsDemo"). It's the last switch so just remove it and recompile.
Let me know if you need assistance but you're likely already familiar with
Compiler Explorer.

Unfortunately I can't strip the code down to a minimally reproducible example
(way too much work) so hopefully you can figure out the issue without too much
effort. Easier said than done I know but at least the error message isn't that
long so hopefully it will be enough to quickly isolate the problem.

Let me know if you require any further assistance, I'll be glad to help if I
can. Thanks.

Reply via email to