https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79419
Bug ID: 79419
Summary: Explicit specialization of constrained member
template: ICE in set_constraints
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hstong at ca dot ibm.com
Target Milestone: ---
### SOURCE (<stdin>):
template <typename T>
struct A {
template <typename U>
requires U::happyA
static void foo();
//template <typename U>
//requires U::happyB
//static void foo();
};
template <>
template <typename U>
requires U::happyA
void A<int>::foo() { }
### COMPILER INVOCATION:
g++ -std=c++1z -fconcepts -c -o /dev/null -x c++ -
### OUTPUT:
<stdin>:15:18: internal compiler error: in set_constraints, at cp/pt.c:25605
0x60cae9 set_constraints(tree_node*, tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:25605
0x62ee9b determine_specialization
/home/heads/gcc/gcc-source/gcc/cp/pt.c:2376
0x62f1fa check_explicit_specialization(tree_node*, tree_node*, int, int)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:2972
0x5b2544 grokfndecl
/home/heads/gcc/gcc-source/gcc/cp/decl.c:8833
0x6004ae grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/home/heads/gcc/gcc-source/gcc/cp/decl.c:12180
0x602576 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/decl.c:15096
0x688634 cp_parser_function_definition_from_specifiers_and_declarator
/home/heads/gcc/gcc-source/gcc/cp/parser.c:26071
0x688634 cp_parser_init_declarator
/home/heads/gcc/gcc-source/gcc/cp/parser.c:19152
0x667e7a cp_parser_single_declaration
/home/heads/gcc/gcc-source/gcc/cp/parser.c:26661
0x68399c cp_parser_template_declaration_after_parameters
/home/heads/gcc/gcc-source/gcc/cp/parser.c:26265
0x6836fb cp_parser_explicit_template_declaration
/home/heads/gcc/gcc-source/gcc/cp/parser.c:26500
0x6836fb cp_parser_template_declaration_after_export
/home/heads/gcc/gcc-source/gcc/cp/parser.c:26519
0x66806b cp_parser_explicit_specialization
/home/heads/gcc/gcc-source/gcc/cp/parser.c:16292
0x66837e cp_parser_declaration
/home/heads/gcc/gcc-source/gcc/cp/parser.c:12436
0x68dc7b cp_parser_declaration_seq_opt
/home/heads/gcc/gcc-source/gcc/cp/parser.c:12366
0x68df62 cp_parser_translation_unit
/home/heads/gcc/gcc-source/gcc/cp/parser.c:4369
0x68df62 c_parse_file()
/home/heads/gcc/gcc-source/gcc/cp/parser.c:38354
0x75b223 c_common_parse_file()
/home/heads/gcc/gcc-source/gcc/c-family/c-opts.c:1107
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
### g++ -v output:
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-head/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-head/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/heads/gcc/gcc-source/configure
--prefix=/usr/local/gcc-head --enable-languages=c,c++ --enable-lto
--disable-multilib --without-ppl --without-cloog-ppl --enable-checking=release
--disable-nls
Thread model: posix
gcc version 7.0.1 20170125 (experimental) (GCC)