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
This commit is contained in:
parent
0c4c49092a
commit
a5b5c8b624
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
* 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,
|
||||
set_c_expr_source_range (&expr, init.src_range);
|
||||
expr.original_code = ERROR_MARK;
|
||||
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)
|
||||
{
|
||||
|
@ -3,6 +3,9 @@
|
||||
PR c/71574
|
||||
* 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>
|
||||
|
||||
PR middle-end/68217
|
||||
|
11
gcc/testsuite/gcc.dg/noncompile/pr71583.c
Normal file
11
gcc/testsuite/gcc.dg/noncompile/pr71583.c
Normal file
@ -0,0 +1,11 @@
|
||||
/* 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" } */
|
||||
}
|
Loading…
Reference in New Issue
Block a user