User account creation filtered due to spam.

Bug 71543 - [concepts] ICE on ill-formed declaration of a parameter with a constrained-type-specifier in a requires expression
Summary: [concepts] ICE on ill-formed declaration of a parameter with a constrained-ty...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: ice-on-invalid-code
Depends on:
Blocks: concepts
  Show dependency treegraph
Reported: 2016-06-15 14:55 UTC by Tom Honermann
Modified: 2017-05-15 04:31 UTC (History)
6 users (show)

See Also:
Known to work:
Known to fail: 7.0
Last reconfirmed: 2017-03-07 00:00:00

repo test case for confirming bug (383 bytes, text/x-csrc)
2017-03-07 00:54 UTC, Jeff Trull

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Honermann 2016-06-15 14:55:12 UTC
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://
Relative URL: ^/trunk
Repository Root: svn://
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
0x7539cc cp_parser_maybe_constrained_type_specifier
0x753af8 cp_parser_nonclass_name
0x761d41 cp_parser_type_name
0x761d41 cp_parser_simple_type_specifier
0x75dbdd cp_parser_type_specifier
0x773494 cp_parser_decl_specifier_seq
0x775159 cp_parser_parameter_declaration
0x7759a4 cp_parser_parameter_declaration_list
0x775e44 cp_parser_parameter_declaration_clause
0x7592db cp_parser_requirement_parameter_list
0x7592db cp_parser_requires_expression
0x7592db cp_parser_primary_expression
0x762775 cp_parser_postfix_expression
0x760b5c cp_parser_unary_expression
0x76ad47 cp_parser_cast_expression
0x76b333 cp_parser_binary_expression
0x76bc24 cp_parser_assignment_expression
0x76c06a cp_parser_constant_expression
0x76c8c4 cp_parser_initializer_clause
Comment 1 Jeff Trull 2017-03-07 00:54:42 UTC
Created attachment 40899 [details]
repo test case for confirming bug

I observe the (seemingly) same ICE with 7.0.1 on Compiler Explorer ( today with the attached code.
Comment 2 Martin Sebor 2017-03-07 23:56:15 UTC
Confirmed.  The ICE seems to have been there since the introduction of -fconcepts.