Commit bfcfbfa0 by Marek Polacek Committed by Marek Polacek

re PR c/68090 (VLA compound literal -- "confused by earlier errors, bailing out")

	PR c/68090
	* c-parser.c (c_parser_postfix_expression_after_paren_type): Don't
	deal with pre-evaluation on invalid types.

	* gcc.dg/pr68090.c: New test.

From-SVN: r229823
parent 5d819bb7
2015-11-05 Marek Polacek <polacek@redhat.com>
PR c/68090
* c-parser.c (c_parser_postfix_expression_after_paren_type): Don't
deal with pre-evaluation on invalid types.
2015-11-05 Jakub Jelinek <jakub@redhat.com>
Ilya Verbin <ilya.verbin@intel.com>
......
......@@ -7855,7 +7855,7 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
expr.value = build_compound_literal (start_loc, type, init.value, non_const);
expr.original_code = ERROR_MARK;
expr.original_type = NULL;
if (type_expr)
if (type != error_mark_node && type_expr)
{
if (TREE_CODE (expr.value) == C_MAYBE_CONST_EXPR)
{
......
2015-11-05 Marek Polacek <polacek@redhat.com>
PR c/68090
* gcc.dg/pr68090.c: New test.
2015-11-05 James Greenhalgh <james.greenhalgh@arm.com>
* gcc.dg/ifcvt-4.c: New.
......
/* PR c/68090 */
/* { dg-do compile } */
/* { dg-options "" } */
void
fn (int i)
{
(int[(0, 1)]) { 0 }; /* { dg-error "compound literal has variable size" } */
(int[i]) { 0 }; /* { dg-error "compound literal has variable size" } */
(int[(0, i)]) { 0 }; /* { dg-error "compound literal has variable size" } */
(int [][i]){ 0 }; /* { dg-error "compound literal has variable size" } */
(int [][(1, 2)]){ 0 }; /* { dg-error "compound literal has variable size" } */
}
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