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.carl...@oracle.com>

        PR c++/50611
        * pt.c (tsubst_copy_and_build): If (complain & tf_error) is false
        do not call unqualified_name_lookup_error.
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;
       }
 

Reply via email to