Hi all, Jason,
the large testcase attached by Jon to this PR triggers an "Internal
compiler error: Error reporting routines re-entered." from
-fdump-tree-gimple. The immediate cause seems obvious: in one place in
tsubst_copy_and_build we are calling unqualified_name_lookup_error
unconditionally, thus irrespective of complain. Changing that indeed
avoids the ICE.
Then I come to the existing testcase which doesn't pass as-is: it's the
testcase added by Jason as part of fixing 50075, which, as analyzed by
Jason himself, was clearly about an endless recursion. Currently,
however, we error out with that unqualified_name_lookup_error, once, and
we don't mention the recursion in the error message. With the patchlet
applied, the diagnostics actually shows the recursion, and we error out
few lines above in tsubst_copy_and_build, with the error messages koenig
lookup related. That makes some sense to me, but the testcase needs
tweaking.
Thanks,
Paolo.
////////////////////////
Index: testsuite/g++.dg/cpp0x/decltype32.C
===================================================================
--- testsuite/g++.dg/cpp0x/decltype32.C (revision 191479)
+++ testsuite/g++.dg/cpp0x/decltype32.C (working copy)
@@ -3,10 +3,10 @@
template <typename T>
auto make_array(const T& il) ->
-decltype(make_array(il)) // { dg-error "not declared" }
+decltype(make_array(il)) // { dg-error "not declared|no matching|exceeds" }
{ }
int main()
{
- int z = make_array(1); // { dg-error "no match" }
+ int z = make_array(1); // { dg-error "no matching" }
}
Index: cp/pt.c
===================================================================
--- cp/pt.c (revision 191483)
+++ cp/pt.c (working copy)
@@ -13771,7 +13771,8 @@ tsubst_copy_and_build (tree t,
}
if (TREE_CODE (function) == IDENTIFIER_NODE)
{
- unqualified_name_lookup_error (function);
+ if (complain & tf_error)
+ unqualified_name_lookup_error (function);
release_tree_vector (call_args);
RETURN (error_mark_node);
}