>> I try compile reflection test code with std module without
>> -freflection but build std module with -freflection. An ICE
>> accur when I do this.
>
> Can you give us instruction to reproduce the crash?
The following is my reproduction record.
$ cat main.cc
import std;
template <typename T>
consteval auto nsdm_of() {
const auto ctx = std::meta::access_context::current();
return std::define_static_array(std::meta::nonstatic_data_members_of(^^T,
ctx));
}
int main() {
constexpr auto I = nsdm_of<std::vector<int>>();
}
$ g++ -B. -std=c++26 -fmodules -freflection -fmodule-only --compile-std-module
$ g++ -B. -std=c++26 -fmodules main.cc
main.cc: In function 'consteval auto nsdm_of()':
main.cc:5:33: internal compiler error: Segmentation fault
5 | const auto ctx = std::meta::access_context::current();
| ^~~~~~~~~~~~~~
0x7e56d5a45caf ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x5a369664f652 decl_value
../../gcc/cp/module.cc:8968
0x5a3696647854 tree_node
../../gcc/cp/module.cc:10448
0x5a369664d161 module_state::read_cluster(unsigned int)
../../gcc/cp/module.cc:17735
0x5a369664dd07 module_state::load_section(unsigned int, binding_slot*)
../../gcc/cp/module.cc:21580
0x5a369664ddc8 module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/cp/module.cc:22609
0x5a3696649265 tree_node
../../gcc/cp/module.cc:11057
0x5a369664d0fb module_state::read_cluster(unsigned int)
../../gcc/cp/module.cc:17572
0x5a369664dd07 module_state::load_section(unsigned int, binding_slot*)
../../gcc/cp/module.cc:21580
0x5a369664ddc8 module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/cp/module.cc:22609
0x5a3696649265 tree_node
../../gcc/cp/module.cc:11057
0x5a369664d0fb module_state::read_cluster(unsigned int)
../../gcc/cp/module.cc:17572
0x5a369664dd07 module_state::load_section(unsigned int, binding_slot*)
../../gcc/cp/module.cc:21580
0x5a369664dedf lazy_load_binding(unsigned int, tree_node*, tree_node*,
binding_slot*)
../../gcc/cp/module.cc:22646
0x5a3696662a4b name_lookup::search_namespace_only(tree_node*)
../../gcc/cp/name-lookup.cc:921
0x5a3696662c02 name_lookup::search_namespace(tree_node*)
../../gcc/cp/name-lookup.cc:1014
0x5a3696662d82 name_lookup::search_namespace(tree_node*)
../../gcc/cp/name-lookup.cc:1009
0x5a3696662d82 name_lookup::search_qualified(tree_node*, bool)
../../gcc/cp/name-lookup.cc:1075
0x5a3696665a85 qualified_namespace_lookup
../../gcc/cp/name-lookup.cc:7750
0x5a3696666b8e lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool)
../../gcc/cp/name-lookup.cc:7709
>
>> With debug, the std::meta::info cannot find original type (this
>> is a builtin type with -freflection), so add a DECL_ORIGINAL_TYPE
>> check.
>>