Commit a5b5c8b6 by Marek Polacek Committed by Marek Polacek

re PR c/71583 (ICE on invalid code on x86_64-linux-gnu (in…

re PR c/71583 (ICE on invalid code on x86_64-linux-gnu (in c_parser_postfix_expression_after_paren_type, at c/c-parser.c:8192))

	PR c/71583
	* c-parser.c (c_parser_postfix_expression_after_paren_type): Also
	check expr.value.

	* gcc.dg/noncompile/pr71583.c: New test.

From-SVN: r238861
parent 0c4c4909
2016-07-29 Marek Polacek <polacek@redhat.com>
PR c/71583
* c-parser.c (c_parser_postfix_expression_after_paren_type): Also
check expr.value.
2016-07-22 Uros Bizjak <ubizjak@gmail.com> 2016-07-22 Uros Bizjak <ubizjak@gmail.com>
* c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1,
......
...@@ -8232,7 +8232,9 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser, ...@@ -8232,7 +8232,9 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
set_c_expr_source_range (&expr, init.src_range); set_c_expr_source_range (&expr, init.src_range);
expr.original_code = ERROR_MARK; expr.original_code = ERROR_MARK;
expr.original_type = NULL; expr.original_type = NULL;
if (type != error_mark_node && type_expr) if (type != error_mark_node
&& expr.value != error_mark_node
&& type_expr)
{ {
if (TREE_CODE (expr.value) == C_MAYBE_CONST_EXPR) if (TREE_CODE (expr.value) == C_MAYBE_CONST_EXPR)
{ {
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
PR c/71574 PR c/71574
* c-c++-common/pr71574.c: New test. * c-c++-common/pr71574.c: New test.
PR c/71583
* gcc.dg/noncompile/pr71583.c: New test.
2016-07-29 Kugan Vivekanandarajah <kuganv@linaro.org> 2016-07-29 Kugan Vivekanandarajah <kuganv@linaro.org>
PR middle-end/68217 PR middle-end/68217
......
/* PR c/71583 */
/* { dg-do compile } */
void
f (int i)
{
(int (*)[++i]) { int }; /* { dg-error "expected" } */
(int (*)[++i]) { }; /* { dg-error "empty" } */
(int (*)[++i]) { , }; /* { dg-error "expected" } */
(int (*)[++i]) { f () }; /* { dg-error "too few" } */
}
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