revert: re PR c/28280 (bogus "statement with no effect" warning with VLA and typeof)
authorMike Stump <mrs@gcc.gnu.org>
Sat, 15 Jul 2006 17:03:44 +0000 (17:03 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Sat, 15 Jul 2006 17:03:44 +0000 (17:03 +0000)
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

gcc/ChangeLog
gcc/c-parser.c
gcc/testsuite/gcc.dg/vla-9.c [deleted file]

index 8bdcd70..0a7a902 100644 (file)
 
 2006-07-12  Mike Stump  <mrs@apple.com>
 
-       PR c/28280
-       * c-parser.c (c_parser_typeof_specifier): Don't use
-       c_finish_expr_stmt, open code desired semantics instead.
-
        * protoize.c (edit_fn_definition): Add volatile to clean_text_p.
 
 2006-07-10  Eric Christopher  <echristo@apple.com>
index d591284..32d2c51 100644 (file)
@@ -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 %<)%>");
diff --git a/gcc/testsuite/gcc.dg/vla-9.c b/gcc/testsuite/gcc.dg/vla-9.c
deleted file mode 100644 (file)
index 0b623b3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* { dg-do compile  } */
-/* { dg-options "-std=c99 -pedantic-errors -W -Wall" } */
-/* PR c/28280 */
-
-void f(__SIZE_TYPE__ d)
-{
-  typedef int t[d];
-  t *g = (__typeof (g)) d;
-}