https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120363
Bug ID: 120363
Summary: internal compiler error: in tree_node, at
cp/module.cc:9956
Product: gcc
Version: 15.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc at acb dot anonaddy.me
Target Milestone: ---
I am trying to convert an existing C++ project to modules. It is mostly working
fine however on gcc14 and gcc15 with cmake 4.0.1 and cmake 3.31.7 I am getting
the following error:
/workspaces/gw2cc_private_linux/src/gw2cc/algo/TSPSolver.ixx:6:8: internal
compiler error: in tree_node, at cp/module.cc:9956
6 | export module gw2cc.algo:tsp_solver;
| ^~~~~~
0x7f24d269f1c9 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f24d269f28a __libc_start_main_impl
../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source.
I was able to narrow it down to files that use the GDCLASS macro here:
https://github.com/godotengine/godot/blob/be3ecaeb3c51433058ad4e96ec892d18f4291efd/core/object/object.h#L415
Modules with a similar structure that do not use the macro work fine. I have
attached the output of -freport-bug as instructed by the error message.
For what its worth, MSVC has no issues compiling this.
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-linux-gnu/15.1.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: /usr/src/gcc/configure --build=x86_64-linux-gnu
--disable-multilib --enable-languages=c,c++,fortran,go
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (GCC)