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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2025-04-03
     Ever confirmed|0                           |1
                 CC|                            |nshead at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
             Blocks|                            |103524

--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed.  A curious reduction; reformatting the 'visit' forward-decl causes
it to go away:

  // test.cpp
  export module repro;

  template<class Visitor>
  auto
  visit(
    Visitor v
  ) -> decltype(
    v(0));

  template<class Visitor> auto visit(Visitor v) -> decltype(v(0)) {}

$ g++-15 -fmodules -std=c++23 -S test.cpp
test.cpp:1:8: internal compiler error: in write_location, at cp/module.cc:17561
    1 | export module repro;
      |        ^~~~~~
0x3ccec85 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:517
0x3c99890 fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostic.cc:1749
0x1143372 write_location
        ../../gcc/gcc/cp/module.cc:17561
0x1142e2d write_location
        ../../gcc/gcc/cp/module.cc:17467
0x110f586 core_vals
        ../../gcc/gcc/cp/module.cc:6281
0x1114cf6 tree_node_vals
        ../../gcc/gcc/cp/module.cc:7683
0x111ed81 tree_value
        ../../gcc/gcc/cp/module.cc:9670
0x1120053 tree_node
        ../../gcc/gcc/cp/module.cc:9982
0x110fdab core_vals
        ../../gcc/gcc/cp/module.cc:6410
0x1114cf6 tree_node_vals
        ../../gcc/gcc/cp/module.cc:7683
0x111ed81 tree_value
        ../../gcc/gcc/cp/module.cc:9670
0x1120053 tree_node
        ../../gcc/gcc/cp/module.cc:9982
0x111e302 type_node
        ../../gcc/gcc/cp/module.cc:9550
0x111fe15 tree_node
        ../../gcc/gcc/cp/module.cc:9934
0x112810b key_mergeable
        ../../gcc/gcc/cp/module.cc:11574
0x111721b decl_value
        ../../gcc/gcc/cp/module.cc:8287
0x111b236 decl_node
        ../../gcc/gcc/cp/module.cc:8984
0x1120028 tree_node
        ../../gcc/gcc/cp/module.cc:9977
0x113f33e module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
        ../../gcc/gcc/cp/module.cc:16391
0x114a5da module_state::write_begin(elf_out*, cpp_reader*,
module_state_config&, unsigned int&)
        ../../gcc/gcc/cp/module.cc:19784
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue

Reply via email to