diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-05-20 12:17:36 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-05-20 08:17:36 -0400 |
commit | 06126ca285bb5ec114d8a1c2db4de6c6d8e96d1d (patch) | |
tree | cf2b4420b909e1bdaffb4cfe298a3436f0289f68 /gcc | |
parent | 87533b37c7f8d54d0dad71d1a44a541d5ff36587 (diff) | |
download | gcc-06126ca285bb5ec114d8a1c2db4de6c6d8e96d1d.zip gcc-06126ca285bb5ec114d8a1c2db4de6c6d8e96d1d.tar.gz gcc-06126ca285bb5ec114d8a1c2db4de6c6d8e96d1d.tar.bz2 |
tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/tree.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c4bb98b..801aeea 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 3f7e5ca..a305cb5 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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; |