Bug 84822 - Partial specializing template<auto> internal compiler error
Summary: Partial specializing template<auto> internal compiler error
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code
Depends on:
Reported: 2018-03-11 21:22 UTC by Fei Teng
Modified: 2019-06-18 19:53 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2018-03-12 00:00:00

the preprocessed file (*.i*) that triggers the bug (311 bytes, text/plain)
2018-03-11 21:22 UTC, Fei Teng

Note You need to log in before you can comment on or make changes to this bug.
Description Fei Teng 2018-03-11 21:22:53 UTC
Created attachment 43625 [details]
the preprocessed file (*.i*) that triggers the bug

When partially specializing template<auto> with more than one auto non-type template parameters, a mixed usage of auto non-type template argument and named non-type template argument causes ICE. 
Example code 
contains several variants of the error.

g++ (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0

g++ partialspecializationbug.cpp -std=c++17

partialspecializationbug.cpp:72:34: internal compiler error: Segmentation fault
     Listener<&Foo::evt, &Bar::f> conn;
0xae558f crash_signal
0x5e187a unify
0x5e1680 unify
0x5f36e1 unify_one_argument
0x5f8726 type_unification_real
0x5e0313 do_auto_deduction(tree_node*, tree_node*, tree_node*, int, auto_deduction_context, tree_node*, int)
0x5e1f5d unify
0x5e1508 unify
0x5e2991 get_partial_spec_bindings
0x5e2d1d most_specialized_partial_spec
0x5fe4db instantiate_class_template_1
0x5fe4db instantiate_class_template(tree_node*)
0x662305 complete_type(tree_node*)
0x5cea01 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**)
0x61e302 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*)
0x63343b cp_parser_member_declaration
0x633e0a cp_parser_member_specification_opt
0x633e0a cp_parser_class_specifier_1
0x635a61 cp_parser_class_specifier
0x635a61 cp_parser_type_specifier
Comment 1 Richard Biener 2018-03-12 09:24:13 UTC
Comment 2 Marek Polacek 2018-03-12 09:46:12 UTC
Started with r242017.  Rejected before:
error: ‘auto’ parameter not permitted in this context
Comment 3 Marek Polacek 2019-06-18 19:53:52 UTC
Still ICEs.