break;
if (! decl || TREE_TYPE (decl) == error_mark_node)
- continue;
+ {
+ any_error = 1;
+ continue;
+ }
type = TREE_TYPE (decl);
if (VOID_TYPE_P (type))
TREE_TYPE (decl) = type;
}
else if (abstract_virtuals_error (decl, type))
- any_error = 1; /* Seems like a good idea. */
+ /* Ignore any default argument. */
+ init = NULL_TREE;
else if (cxx_dialect < cxx17 && INDIRECT_TYPE_P (type))
{
/* Before C++17 DR 393:
decl, t);
}
- if (any_error)
- init = NULL_TREE;
- else if (init && !processing_template_decl)
+ if (init && !processing_template_decl)
init = check_default_argument (decl, init, tf_warning_or_error);
}
if (parm)
result = chainon (result, void_list_node);
*parms = decls;
+ if (any_error)
+ result = NULL_TREE;
+
+ if (any_error)
+ /* We had parm errors, recover by giving the function (...) type. */
+ result = NULL_TREE;
return result;
}
typedef void (A::T)(); /* { dg-error "15:typedef name may not be a nested" } */
-void bar(T); /* { dg-message "note: declared here" } */
+void bar(T);
void baz()
{
- bar(&A::foo); /* { dg-error "too many arguments" } */
+ bar(&A::foo);
}