[C++] PR 50611

Submitted by Paolo Carlini on Oct. 11, 2011, 12:13 p.m.

Details

Message ID 4E9432F5.9050801@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 11, 2011, 12:13 p.m.
Hi,

for this largish testcase (reduced from a big one by Jakub) we ICE due 
to error reporting routines re-entered. In 4_6-branch the situation is 
worse, because for the original testcase we don't produce any useful 
diagnostics at all before ICEing.

Thus the below, which seems pretty straightforward to me given that 
unqualified_name_lookup_error, called by tsubst_copy_and_build (in turn 
called by tsubst, called by dump_template_bindings) errors out 
unconditionally.

Tested mainline and 4_6-branch. Ok for both?

Thanks,
Paolo.

///////////////////////
2011-10-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50611
	* pt.c (tsubst_copy_and_build): If (complain & tf_error) is false
	do not call unqualified_name_lookup_error.

Comments

Jason Merrill Oct. 11, 2011, 1:04 p.m.
OK.

Jason

Patch hide | download patch | download mbox

Index: pt.c
===================================================================
--- pt.c	(revision 179798)
+++ pt.c	(working copy)
@@ -13026,7 +13026,11 @@  tsubst_copy_and_build (tree t,
 	if (error_msg)
 	  error (error_msg);
 	if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE)
-	  decl = unqualified_name_lookup_error (decl);
+	  {
+	    if (complain & tf_error)
+	      unqualified_name_lookup_error (decl);
+	    decl = error_mark_node;
+	  }
 	return decl;
       }