https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71543
Bug ID: 71543 Summary: [concepts] ICE on ill-formed declaration of a parameter with a constrained-type-specifier in a requires expression Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tom at honermann dot net CC: andrew.n.sutton at gmail dot com, asutton at gcc dot gnu.org Target Milestone: --- The following ill-formed code triggers an ICE in gcc trunk r236947. The code is ill-formed because constrained-type-specifiers are not permitted to declare parameters in requires expressions. $ cat t.cpp template<typename T> concept bool C1 = true; template<typename T> concept bool C2 = requires(C1 c1) {}; $ svn info Path: . Working Copy Root Path: /home/tom/src/gcc-trunk URL: svn://gcc.gnu.org/svn/gcc/trunk Relative URL: ^/trunk Repository Root: svn://gcc.gnu.org/svn/gcc Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 Revision: 236947 Node Kind: directory Schedule: normal Last Changed Author: jason Last Changed Rev: 236947 Last Changed Date: 2016-05-31 15:49:22 -0400 (Tue, 31 May 2016) $ gcc --version gcc (GCC) 7.0.0 20160531 (experimental) ... $ g++ -c -std=c++1z -fconcepts t.cpp t.cpp:4:28: internal compiler error: in synthesize_implicit_template_parm, at cp/parser.c:37843 concept bool C2 = requires(C1 c1) {}; ^~ 0x753793 synthesize_implicit_template_parm ../../gcc-trunk/gcc/cp/parser.c:37843 0x7539cc cp_parser_maybe_constrained_type_specifier ../../gcc-trunk/gcc/cp/parser.c:16463 0x753af8 cp_parser_nonclass_name ../../gcc-trunk/gcc/cp/parser.c:16541 0x761d41 cp_parser_type_name ../../gcc-trunk/gcc/cp/parser.c:16347 0x761d41 cp_parser_simple_type_specifier ../../gcc-trunk/gcc/cp/parser.c:16261 0x75dbdd cp_parser_type_specifier ../../gcc-trunk/gcc/cp/parser.c:15914 0x773494 cp_parser_decl_specifier_seq ../../gcc-trunk/gcc/cp/parser.c:12758 0x775159 cp_parser_parameter_declaration ../../gcc-trunk/gcc/cp/parser.c:20448 0x7759a4 cp_parser_parameter_declaration_list ../../gcc-trunk/gcc/cp/parser.c:20263 0x775e44 cp_parser_parameter_declaration_clause ../../gcc-trunk/gcc/cp/parser.c:20184 0x7592db cp_parser_requirement_parameter_list ../../gcc-trunk/gcc/cp/parser.c:24391 0x7592db cp_parser_requires_expression ../../gcc-trunk/gcc/cp/parser.c:24362 0x7592db cp_parser_primary_expression ../../gcc-trunk/gcc/cp/parser.c:5098 0x762775 cp_parser_postfix_expression ../../gcc-trunk/gcc/cp/parser.c:6688 0x760b5c cp_parser_unary_expression ../../gcc-trunk/gcc/cp/parser.c:7986 0x76ad47 cp_parser_cast_expression ../../gcc-trunk/gcc/cp/parser.c:8663 0x76b333 cp_parser_binary_expression ../../gcc-trunk/gcc/cp/parser.c:8764 0x76bc24 cp_parser_assignment_expression ../../gcc-trunk/gcc/cp/parser.c:9051 0x76c06a cp_parser_constant_expression ../../gcc-trunk/gcc/cp/parser.c:9321 0x76c8c4 cp_parser_initializer_clause ../../gcc-trunk/gcc/cp/parser.c:20837 ...