From d186f8877f5bd36a2204c6b2bf84cc0c73a30cde Mon Sep 17 00:00:00 2001 From: mmitchel Date: Sat, 22 May 1999 11:24:43 +0000 Subject: [PATCH] * tree.c (mapcar): Handle LVALUE_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27101 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 2 ++ gcc/cp/tree.c | 1 + gcc/testsuite/g++.old-deja/g++.other/new4.C | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/new4.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 39cec748146..f0b989c4a92 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 1999-05-22 Mark Mitchell + * tree.c (mapcar): Handle LVALUE_EXPR. + * cp-tree.h (cplus_expand_constant): Declare. * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're converted from one pointer-to-object type to another. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 9d77217e0a8..1d1f205ddee 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1927,6 +1927,7 @@ mapcar (t, func) case NOP_EXPR: case COMPONENT_REF: case CLEANUP_POINT_EXPR: + case NON_LVALUE_EXPR: t = copy_node (t); TREE_TYPE (t) = mapcar (TREE_TYPE (t), func); TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func); diff --git a/gcc/testsuite/g++.old-deja/g++.other/new4.C b/gcc/testsuite/g++.old-deja/g++.other/new4.C new file mode 100644 index 00000000000..b9931b1caa5 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/new4.C @@ -0,0 +1,10 @@ +// Build don't link: +// Origin: Mark Mitchell + +struct S { + S(); + + virtual int f() { + new S[+f()]; + } +}; -- 2.11.0