summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>2006-07-15 17:03:44 +0000
committerMike Stump <mrs@gcc.gnu.org>2006-07-15 17:03:44 +0000
commit9c9309815325c3da45ec43a0949f6619788e80ad (patch)
tree4e0892ab45f40ba77aeff9cf7c1e4f5e94ba1581 /gcc/c-parser.c
parent8daa14ad2afd0ab60cad426b15583d12b5fdc6c5 (diff)
downloadgcc-9c9309815325c3da45ec43a0949f6619788e80ad.tar.gz
revert: re PR c/28280 (bogus "statement with no effect" warning with VLA and typeof)
Revert: PR c/28280 * c-parser.c (c_parser_typeof_specifier): Don't use c_finish_expr_stmt, open code desired semantics instead. From-SVN: r115479
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index d59128480c8..32d2c5108bf 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -2164,19 +2164,7 @@ c_parser_typeof_specifier (c_parser *parser)
is evaluated, this can be evaluated. For now, we avoid
evaluation when the context might. */
if (!skip_evaluation && was_vm)
- {
- tree e = expr.value;
-
- /* If the expression is not of a type to which we cannot assign a line
- number, wrap the thing in a no-op NOP_EXPR. */
- if (DECL_P (e) || CONSTANT_CLASS_P (e))
- e = build1 (NOP_EXPR, void_type_node, e);
-
- if (EXPR_P (e))
- SET_EXPR_LOCATION (e, input_location);
-
- add_stmt (e);
- }
+ c_finish_expr_stmt (expr.value);
pop_maybe_used (was_vm);
}
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>");