https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67210
Bug ID: 67210 Summary: [concepts] Error parsing ">>" after a template-id that names a concept Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: Casey at Carter dot net Target Milestone: --- Created attachment 36183 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36183&action=edit Test case r226833 ICEs compiling this correct TU: template <class T, class U> concept bool C = true; template <class T> struct A {}; void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) with error: ~/gcc6-r226833/bin/g++ -std=gnu++1z foo.cpp -c foo.cpp:7:10: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct A’ void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) ^ foo.cpp:7:10: note: expected a type, got ‘C<int>’ foo.cpp:7:10: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct A’ foo.cpp:7:10: note: expected a type, got ‘C<int>’ foo.cpp:7:10: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct A’ foo.cpp:7:10: note: expected a type, got ‘C<int>’ foo.cpp:7:8: error: variable or field ‘f’ declared void void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) ^ foo.cpp:7:10: error: wrong number of template arguments (1, should be 2) void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) ^ foo.cpp:2:14: note: provided for ‘template<class T, class U> constexpr const bool C<T, U>’ concept bool C = true; ^ foo.cpp:7:10: error: wrong number of template arguments (1, should be 2) void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) ^ foo.cpp:2:14: note: provided for ‘template<class T, class U> constexpr const bool C<T, U>’ concept bool C = true; ^ foo.cpp:7:10: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct A’ void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) ^ foo.cpp:7:10: note: expected a type, got ‘true’ foo.cpp:7:17: internal compiler error: tree check: expected tree that contains ‘decl minimal’ structure, have ‘error_mark’ in cp_parser_init_declarator, at cp/parser.c:17813 void f(A<C<int>>) {} // Error ("void f(A<C<int> >)" works fine) ^ 0xf05fc4 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.c:9667 0x71d266 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.h:2972 0x71d266 cp_parser_init_declarator ../../gcc/cp/parser.c:17813 0x71f6e5 cp_parser_simple_declaration ../../gcc/cp/parser.c:11681 0x718e83 cp_parser_block_declaration ../../gcc/cp/parser.c:11555 0x724cc7 cp_parser_declaration ../../gcc/cp/parser.c:11452 0x72346a cp_parser_declaration_seq_opt ../../gcc/cp/parser.c:11334 0x723789 cp_parser_translation_unit ../../gcc/cp/parser.c:4154 0x723789 c_parse_file() ../../gcc/cp/parser.c:34271 0x86d1a2 c_common_parse_file() ../../gcc/c-family/c-opts.c:1058 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.