diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 19:55:36 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 19:55:36 +0000 |
commit | 94b5c9e7f8d15ece6dfa43c2bbf29fb0d053b46b (patch) | |
tree | e77352b3962f65cd032090753790f973b56f0f82 /gcc/c-parser.c | |
parent | e703e1fcce892fb577a81fe9ffe3810b0c9c6f36 (diff) | |
download | gcc-94b5c9e7f8d15ece6dfa43c2bbf29fb0d053b46b.tar.gz |
2011-11-30 Andrew Pinski <apinski@cavium.com>
PR c/51321
* c-parser.c (c_parser_postfix_expression): Check groktypename results
before looking at the main variant.
2011-11-30 Andrew Pinski <apinski@cavium.com>
* gcc.dg/pr51321.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index b88b11fc430..e227137bfb0 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -6568,9 +6568,16 @@ c_parser_postfix_expression (c_parser *parser) "expected %<)%>"); { tree e1, e2; + e1 = groktypename (t1, NULL, NULL); + e2 = groktypename (t2, NULL, NULL); + if (e1 == error_mark_node || e2 == error_mark_node) + { + expr.value = error_mark_node; + break; + } - e1 = TYPE_MAIN_VARIANT (groktypename (t1, NULL, NULL)); - e2 = TYPE_MAIN_VARIANT (groktypename (t2, NULL, NULL)); + e1 = TYPE_MAIN_VARIANT (e1); + e2 = TYPE_MAIN_VARIANT (e2); expr.value = comptypes (e1, e2) ? integer_one_node : integer_zero_node; |