decl2.c (grok_alignof): Don't decay lvalues.
authorNathan Sidwell <nathan@acm.org>
Mon, 4 Oct 1999 15:13:26 +0000 (15:13 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 4 Oct 1999 15:13:26 +0000 (15:13 +0000)
* decl2.c (grok_alignof): Don't decay lvalues.

* init.c (build_new): Remove unused variable.

From-SVN: r29805

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/init.c

index ff9137b..0588f0d 100644 (file)
@@ -1,3 +1,9 @@
+1999-10-04  Nathan Sidwell  <nathan@acm.org>
+
+       * decl2.c (grok_alignof): Don't decay lvalues.
+       
+       * init.c (build_new): Remove unused variable.
+
 1999-10-04  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (struct language_function): Remove static_labelno.
index b3cdad4..e128e8c 100644 (file)
@@ -1050,17 +1050,7 @@ grok_alignof (expr)
       return c_alignof (TREE_TYPE (TREE_TYPE (best)));
     }
   else
-    {
-      /* ANSI says arrays and fns are converted inside comma.
-        But we can't convert them in build_compound_expr
-        because that would break commas in lvalues.
-        So do the conversion here if operand was a comma.  */
-      if (TREE_CODE (expr) == COMPOUND_EXPR
-         && (TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
-             || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
-       expr = default_conversion (expr);
-      return c_alignof (TREE_TYPE (expr));
-    }
+    return c_alignof (TREE_TYPE (expr));
 }
 
 /* Create an ARRAY_REF, checking for the user doing things backwards
index 0bd2740..83fd8c5 100644 (file)
@@ -1895,8 +1895,6 @@ build_new (placement, decl, init, use_global_new)
   tree nelts = NULL_TREE, t;
   int has_array = 0;
 
-  tree pending_sizes = NULL_TREE;
-
   if (decl == error_mark_node)
     return error_mark_node;
 
@@ -2054,10 +2052,6 @@ build_new (placement, decl, init, use_global_new)
   rval = build1 (NOP_EXPR, TREE_TYPE (rval), rval);
   TREE_NO_UNUSED_WARNING (rval) = 1;
 
-  if (pending_sizes)
-    rval = build_compound_expr (chainon (pending_sizes,
-                                        build_expr_list (NULL_TREE, rval)));
-
   return rval;
 }