+2011-12-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51404
+ * typeck2.c (build_functional_cast): Early return error_mark_node
+ for invalid uses of 'auto'.
+ * parser.c (cp_parser_direct_declarator): When
+ cp_parser_constant_expression returns error do not produce further
+ diagnostic for the bound.
+
2011-12-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51313
&non_constant_p);
if (!non_constant_p)
/* OK */;
- /* Normally, the array bound must be an integral constant
- expression. However, as an extension, we allow VLAs
- in function scopes as long as they aren't part of a
- parameter declaration. */
+ else if (error_operand_p (bounds))
+ /* Already gave an error. */;
else if (!parser->in_function_body
|| current_binding_level->kind == sk_function_parms)
{
+ /* Normally, the array bound must be an integral constant
+ expression. However, as an extension, we allow VLAs
+ in function scopes as long as they aren't part of a
+ parameter declaration. */
cp_parser_error (parser,
"array bound is not an integer constant");
bounds = error_mark_node;
}
- else if (processing_template_decl && !error_operand_p (bounds))
+ else if (processing_template_decl)
{
/* Remember this wasn't a constant-expression. */
bounds = build_nop (TREE_TYPE (bounds), bounds);
{
if (complain & tf_error)
error ("invalid use of %<auto%>");
- type = error_mark_node;
+ return error_mark_node;
}
if (processing_template_decl)
+2011-12-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51404
+ * g++.dg/cpp0x/auto28.C: New.
+
2011-12-05 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* gcc.dg/torture/vec-cvt-1.c (FLTTEST): Call rand instead of random.