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

--- Comment #3 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
Simplified: https://godbolt.org/z/rnfKrzYaP.

mod.cpp:
```C++
export module mod;

export template<bool B> struct Int {
  explicit(B) operator int() const;
};
```

test.cpp:
```C++
import mod;
int main() {
  return Int<true>{};
}
```

Output:
```
In module mod, imported at /app/test.cpp:1:
mod.cpp: In instantiation of 'struct Int@mod<true>':
test.cpp:3:20:   required from here
mod.cpp:4:15: internal compiler error: Segmentation fault
    4 |   explicit(B) operator int() const;
      |               ^~~~~~~~
0x2139bd9 internal_error(char const*, ...)
        ???:0
0x9ada27 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x9f2c99 instantiate_class_template(tree_node*)
        ???:0
0xa184bc finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
        ???:0
0x97a00d c_parse_file()
        ???:0
0xb08022 c_common_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```

Reply via email to