+2018-05-30 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_check_condition_declarator): Handle
+ cp_error_declarator.
+
2018-05-30 Jonathan Wakely <jwakely@redhat.com>
* typeck.c (cxx_sizeof_or_alignof_type): Return size_one_node instead
cp_declarator *declarator,
location_t loc)
{
- if (function_declarator_p (declarator)
+ if (declarator == cp_error_declarator
+ || function_declarator_p (declarator)
|| declarator->kind == cdk_array)
{
- if (declarator->kind == cdk_array)
+ if (declarator == cp_error_declarator)
+ /* Already complained. */;
+ else if (declarator->kind == cdk_array)
error_at (loc, "condition declares an array");
else
error_at (loc, "condition declares a function");
foo ()
{
auto [ a, b ] = A ();
- for (; auto [ a, b ] = A (); ) // { dg-error "expected|no match" }
+ for (; auto [ a, b ] = A (); ) // { dg-error "expected" }
;
for (; false; auto [ a, b ] = A ()) // { dg-error "expected" }
;