Patchwork [trans-mem] PR47340 (committed): handle new operator (again)

login
register
mail settings
Submitter Aldy Hernandez
Date Jan. 28, 2011, 9:04 p.m.
Message ID <4D432F45.8070207@redhat.com>
Download mbox | patch
Permalink /patch/80895/
State New
Headers show

Comments

Aldy Hernandez - Jan. 28, 2011, 9:04 p.m.
Another corner case of the new operator.  Jason was kind enough to point 
that the TM branch was missing some mainline patches.  I suppose, once I 
settle down the branch, I should merge from mainline.

Applying to branch, and closing the PR.
PR/47340
	* Import the following from mainline:
	2010-06-15  Jason Merrill  <jason@redhat.com>
	[snip]
	* cp/decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
	DECL_SOURCE_LOCATION directly.

Patch

Index: testsuite/g++.dg/tm/pr47340.C
===================================================================
--- testsuite/g++.dg/tm/pr47340.C	(revision 0)
+++ testsuite/g++.dg/tm/pr47340.C	(revision 0)
@@ -0,0 +1,11 @@ 
+// { dg-do compile }
+// { dg-options "-fgnu-tm" }
+
+void* operator new(__SIZE_TYPE__) throw (int);
+
+void *point;
+
+void funky()
+{
+  point = new (int);
+}
Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 169292)
+++ cp/decl.c	(working copy)
@@ -1268,7 +1268,7 @@  duplicate_decls (tree newdecl, tree oldd
       /* Even if the types match, prefer the new declarations type for
 	 built-ins which have not been explicitly declared, for
 	 exception lists, etc...  */
-      else if (DECL_ANTICIPATED (olddecl))
+      else if (DECL_IS_BUILTIN (olddecl))
 	{
 	  tree type = TREE_TYPE (newdecl);
 	  tree attribs = (*targetm.merge_type_attributes)