[patch, c++] Patch for PR c++/38357 - 4.2/4.3/4.4 regression

Steve Ellcey sje@cup.hp.com
Wed Jan 14 21:13:00 GMT 2009


On Mon, 2009-01-12 at 10:39 -0500, Jason Merrill wrote:
> This failure is very like one that Dodji was working on earlier.  I 
> remember thinking when looking at his patch that the simplest thing to 
> do would be to just check at the top of tsubst to see if args == 
> NULL_TREE, and return the input unchanged if so.  I guess we ended up 
> going with a different fix, but that seems like an appropriate fix for 
> this bug too.
> 
> Jason

I tried putting at the very beginning of tsubst, as part of the initial
if statement but that resulted in regressions in the testsuite.  So I
moved it to after the 'if (DECL_P (t))' test and that seemed to work
with no regressions.  How about the following patch as a replacement for
my original change:

2009-01-14  Steve Ellcey  <sje@cup.hp.com>

	PR c++/38357
	* pt.c (tsubst): Check for NULL args.


Index: pt.c
===================================================================
--- pt.c	(revision 143360)
+++ pt.c	(working copy)
@@ -8975,6 +8975,9 @@ tsubst (tree t, tree args, tsubst_flags_
   if (DECL_P (t))
     return tsubst_decl (t, args, complain);
 
+  if (args == NULL_TREE)
+    return t;
+
   if (TREE_CODE (t) == IDENTIFIER_NODE)
     type = IDENTIFIER_TYPE_VALUE (t);
   else



More information about the Gcc-patches mailing list