aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-01-18 15:25:02 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2008-01-18 15:25:02 +0000
commit1ea193c21f060b7e7837138122b24c9d07f57d57 (patch)
treef599ef6905608f93f1d83e94f82e9ef89480d5b3 /gcc/c-decl.c
parentc27fb14bda0b2c82c0fe8413e3e2f805c1d58975 (diff)
downloadgcc-1ea193c21f060b7e7837138122b24c9d07f57d57.zip
gcc-1ea193c21f060b7e7837138122b24c9d07f57d57.tar.gz
gcc-1ea193c21f060b7e7837138122b24c9d07f57d57.tar.bz2
re PR c++/33407 (C++ operator new and new expression do not change dynamic type)
PR c++/33407 ./: * tree.h (DECL_IS_OPERATOR_NEW): Define. (struct tree_function_decl): Add new field operator_new_flag. * tree-inline.c (expand_call_inline): When inlining a call to operator new, force the return value to go into a variable, and set DECL_NO_TBAA_P on that variable. * c-decl.c (merge_decls): Merge DECL_IS_OPERATOR_NEW flag. cp/: * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag. (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set DECL_IS_OPERATOR_NEW flag. testsuite/: * g++.dg/init/new26.C: New test. From-SVN: r131629
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 9237a75..860b337 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1,6 +1,7 @@
/* Process declarations and variables for C compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -1740,6 +1741,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl);
TREE_READONLY (newdecl) |= TREE_READONLY (olddecl);
DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl);
+ DECL_IS_OPERATOR_NEW (newdecl) |= DECL_IS_OPERATOR_NEW (olddecl);
DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl);
DECL_IS_NOVOPS (newdecl) |= DECL_IS_NOVOPS (olddecl);
}