[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 via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.