https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106363
Bug ID: 106363
Summary: [modules] Can't selectively reexport imported
declaration in same namespace
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/a3GqTEs5P, which Clang accepts:
https://godbolt.org/z/svaGvz1bz.
mod2.cpp:
```C++
export module mod2;
namespace ns {
export int x = 0;
}
```
mod.cpp:
```C++
export module mod;
import mod2;
namespace ns {
export using ns::x;
}
```
test.cpp:
```C++
import mod;
int main() { return ns::x; }
```
Output:
```
[ 62%] Building CXX object CMakeFiles/mod.dir/mod.cpp.o
mod.cpp:1:8: internal compiler error: in decl_node, at cp/module.cc:8678
1 | export module mod;
| ^~~~~~
0x221f229 internal_error(char const*, ...)
???:0
0x74c10d fancy_abort(char const*, int, char const*)
???:0
0x8fcc60 trees_out::decl_node(tree_node*, walk_kind)
???:0
0x8fd01d trees_out::tree_node(tree_node*)
???:0
0x905086 module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
???:0
0x906ace module_state::write_begin(elf_out*, cpp_reader*, module_state_config&,
unsigned int&)
???:0
0x9079f2 finish_module_processing(cpp_reader*)
???:0
0x87253d c_parse_final_cleanups()
???:0
0xb2d060 c_common_parse_file()
???:0
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.
```