]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 20 May 1999 12:17:36 +0000 (12:17 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 May 1999 12:17:36 +0000 (08:17 -0400)
* tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
(build_cplus_new): Make sure that what we return is of the right type.

From-SVN: r27063

gcc/cp/ChangeLog
gcc/cp/tree.c

index c4bb98b95f78f5667c4190ef617d96ceb17d67ec..801aeea9e6d9714958340289f1b7d4155fd55d28 100644 (file)
@@ -1,3 +1,8 @@
+1999-05-20  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
+       (build_cplus_new): Make sure that what we return is of the right type.
+
 1999-05-20  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (make_ptrmem_cst): New function.
index 3f7e5ca213bae3c83964e615fed6fdfd2cb307a0..a305cb5ca2c8850e6c473bb6d628195729f39fef 100644 (file)
@@ -71,6 +71,7 @@ lvalue_p_1 (ref, treat_class_rvalues_as_lvalues)
     case WITH_CLEANUP_EXPR:
     case REALPART_EXPR:
     case IMAGPART_EXPR:
+    case NOP_EXPR:
       return lvalue_p_1 (TREE_OPERAND (ref, 0),
                         treat_class_rvalues_as_lvalues);
 
@@ -193,7 +194,7 @@ build_cplus_new (type, init)
   tree rval;
 
   if (TREE_CODE (init) != CALL_EXPR && TREE_CODE (init) != AGGR_INIT_EXPR)
-    return init;
+    return convert (type, init);
 
   slot = build (VAR_DECL, type);
   DECL_ARTIFICIAL (slot) = 1;