https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120411
Bug ID: 120411
Summary: ICE compiling module relating to typedef struct {}
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cjangus at gmail dot com
Target Milestone: ---
Created attachment 61496
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61496&action=edit
Compressed preprocessed source
Sorry I don't have the time to reduce this further, but I can tell you that the
trigger appears to be the use of the form "typedef union {} name;" (or struct),
see for example line 159368 of the preprocessed file. Switching to "typedef
union name {} name;", or "union name {};" avoids the ICE.
g++ -fPIC -Og -g -Wall -std=c++2b -fmodules -finput-charset=UTF-8 -c -x c++
-fpreprocessed -fdirectives-only function2.gcm.ii
Output:
/home/cjangus/bug-repros/gcc/add-indirects/add-indirects/function2.mxx:6:8:
internal compiler error: in add_indirects, at cp/module.cc:7833
6 | export module function2;
Target: x86_64-pc-linux-gnu
Configured with: ../repo/configure --prefix=/home/cjangus/gcc
--enable-languages=c,c++ --disable-multilib
gcc version 16.0.0 20250522 (experimental) (GCC)