The rule change in the title matches GCC's current behavior, so no change
was needed. But the paper also makes 'typename' optional in a
requirement-parameter-list, so this implements that.
gcc/cp/ChangeLog
2020-02-28 Jason Merrill <jason@redhat.com>
Implement P2092R0, Disambiguating Nested-Requirements
* parser.c (cp_parser_requirement_parameter_list): Pass
CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
2020-02-28 Jason Merrill <jason@redhat.com>
+ Implement P2092R0, Disambiguating Nested-Requirements
+ * parser.c (cp_parser_requirement_parameter_list): Pass
+ CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
+
* call.c (build_user_type_conversion_1): Don't look at the second
conversion of a non-viable candidate.
if (!parens.require_open (parser))
return error_mark_node;
- tree parms
- = cp_parser_parameter_declaration_clause (parser, CP_PARSER_FLAGS_NONE);
+ tree parms = (cp_parser_parameter_declaration_clause
+ (parser, CP_PARSER_FLAGS_TYPENAME_OPTIONAL));
if (!parens.require_close (parser))
return error_mark_node;
--- /dev/null
+// P2092R0
+// { dg-do compile { target concepts } }
+
+template <class T>
+concept Bar = requires (T::type t) { ++t; };
+
+template <class T>
+concept Foo = requires { requires { T(); }; }; // { dg-error "" }