https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117534
Bug ID: 117534
Summary: internal compiler error: Segmentation fault at
check_explicit_specialization(tree_node*, tree_node*,
int, int, 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/f9Wq36qeb
The following valid program:
```cpp
template <class... Ts>
void j(int i = 0, Ts... ts) {}
template <>
void j<int>(int i, int j, int *p, int *q) {}
```
will trigger segmentation fault for gcc trunk.
Stack dump:
```
0x289aac5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28b14b5 internal_error(char const*, ...)
???:0
0xd04cae check_explicit_specialization(tree_node*, tree_node*, int, int,
tree_node*)
???:0
0xb7389c grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
???:0
0xb7683a start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
???:0
0xca0a8a c_parse_file()
???:0
0xdfab89 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
```