Commit 426c1e2e by Jason Merrill Committed by Jason Merrill

PR c++/84798 - ICE with auto in abstract function declarator.

	* parser.c (cp_parser_parameter_declaration_clause): Check
	parser->default_arg_ok_p.

From-SVN: r258493
parent f99309b2
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
......
......@@ -21198,7 +21198,10 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
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;
// 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" }
// PR c++/60393
// { dg-do compile { target c++14 } }
// { dg-options "" }
void (*f)(auto) + 0; // { dg-error "expected" }
void (*f)(auto) + 0; // { dg-error "auto|expected" }
struct A
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment