aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/cp/init.c
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2003-11-07 02:43:04 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2003-11-07 02:43:04 +0000
commitea875f6efe3bb8adfb0cd5c46481e92462efd788 (patch)
tree980c917e2cc50183c4d566d9a0f9a1c818e6a6cd /contrib/gcc/cp/init.c
parent006ca56045367264ed55b8bf2cb0594565911208 (diff)
Gcc 3.3.3 20031106.
Notes
Notes: svn path=/vendor/gcc/dist/; revision=122180
Diffstat (limited to 'contrib/gcc/cp/init.c')
-rw-r--r--contrib/gcc/cp/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/gcc/cp/init.c b/contrib/gcc/cp/init.c
index 83a87537e8b4..91ea10c16cba 100644
--- a/contrib/gcc/cp/init.c
+++ b/contrib/gcc/cp/init.c
@@ -2517,6 +2517,10 @@ build_new_1 (exp)
element. */
rval = convert (build_pointer_type (type), rval);
+ /* A new-expression is never an lvalue. */
+ if (real_lvalue_p (rval))
+ rval = build1 (NON_LVALUE_EXPR, TREE_TYPE (rval), rval);
+
return rval;
}