+2018-03-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/84798 - ICE with auto in abstract function declarator.
+ * parser.c (cp_parser_parameter_declaration_clause): Check
+ parser->default_arg_ok_p.
+
2018-03-13 Jakub Jelinek <jakub@redhat.com>
PR c++/84808
if (!processing_specialization
&& !processing_template_parmlist
- && !processing_explicit_instantiation)
+ && !processing_explicit_instantiation
+ /* default_arg_ok_p tracks whether this is a parameter-clause for an
+ actual function or a random abstract declarator. */
+ && parser->default_arg_ok_p)
if (!current_function_decl
|| (current_class_type && LAMBDA_TYPE_P (current_class_type)))
parser->auto_is_implicit_function_template_parm_p = true;
--- /dev/null
+// PR c++/84798
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct S {
+ static constexpr T value = 0;
+};
+
+constexpr auto x = S<void(*)(auto)>::value; // { dg-error "auto" }