[Bug c++/126440] ICE when importing iostream after export import a module partition: in write_location, at cp/module.cc:18772

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 31 19:35:54 GMT 2026


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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-07-31
     Ever confirmed|0                           |1
                 CC|                            |ppalka at gcc dot gnu.org
           Keywords|                            |ice-checking,
                   |                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Confirmed. Seems not specific to <iostream> or to any other standard library
header unit, or even its contents:

$ cat 126440_a.H
// contents don't matter

$ cat 126440_b.C
export module list:node;
export struct Node {};

$ cat 126440_c.C
export module list;
export import :node; // #1
import "126440_a.H"; // #2

$ g++ -fmodules 126440_{a.H,b.C,c.C}
126440_c.C:1:8: internal compiler error: in write_location, at
cp/module.cc:18835
    1 | export module list;
      |        ^~~~~~

Swapping the order of #1 and #2 makes it work.


More information about the Gcc-bugs mailing list