https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117153
Bug ID: 117153
Summary: internal compiler error: Segmentation fault at
is_overloaded_fn(tree_node*)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: yihan4845 at gmail dot com
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/fYPcEoEa7
The following program:
```
template<typename T>
void f() {
union {
union {
T d;
};
};
d + 0;
}
template void f<double>();
```
will trigger segmentation fault for gcc trunk.
The stack dump:
```
0x286a525 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287e305 internal_error(char const*, ...)
???:0
0xd3d270 is_overloaded_fn(tree_node*)
???:0
0xb020aa potential_constant_expression(tree_node*)
???:0
0xcc0add instantiate_decl(tree_node*, bool, bool)
???:0
0xcfb74b instantiate_pending_templates(int)
???:0
0xb90b1b c_parse_final_cleanups()
???:0
0xdf0c48 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.
Compiler returned: 1
```