+2019-08-05 Marek Polacek <polacek@redhat.com>
+
+ DR 2413 - typename in conversion-function-ids.
+ * parser.c (cp_parser_conversion_type_id): Call
+ cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
+ instead of CP_PARSER_FLAGS_NONE.
+
2019-08-05 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (cp_expr_loc_or_input_loc): New.
parser->type_definition_forbidden_message
= G_("types may not be defined in a conversion-type-id");
- /* Parse the type-specifiers. */
- cp_parser_type_specifier_seq (parser, CP_PARSER_FLAGS_NONE,
+ /* Parse the type-specifiers. DR 2413 clarifies that `typename' is
+ optional in conversion-type-id. */
+ cp_parser_type_specifier_seq (parser, CP_PARSER_FLAGS_TYPENAME_OPTIONAL,
/*is_declaration=*/false,
/*is_trailing_return=*/false,
&type_specifiers);
+2019-08-05 Marek Polacek <polacek@redhat.com>
+
+ DR 2413 - typename in conversion-function-ids.
+ * g++.dg/cpp2a/typename17.C: New test.
+
2019-08-05 Martin Sebor <msebor@redhat.com>
PR middle-end/50476
--- /dev/null
+// DR 2413 - typename in conversion-function-ids.
+// { dg-do compile { target c++2a } }
+
+template<class T> struct S {
+ operator T::X();
+};