Commit 15b31f8c by Jason Merrill Committed by Jason Merrill

re PR c++/59791 (ICE: Error reporting routines re-entered. with -fcompare-debug)

	PR c++/59791
	* pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
	(tsubst_copy): Use it if lookup fails.

From-SVN: r207224
parent 52c02a46
2014-01-28 Jason Merrill <jason@redhat.com>
PR c++/59791
* pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
(tsubst_copy): Use it if lookup fails.
PR c++/59818
* pt.c (tsubst_function_type): Make sure we keep the same function
quals.
......
......@@ -10990,9 +10990,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
DECL_TEMPLATE_INFO (r) = build_template_info (tmpl, argvec);
SET_DECL_IMPLICIT_INSTANTIATION (r);
}
else if (cp_unevaluated_operand)
gcc_unreachable ();
else
else if (!cp_unevaluated_operand)
register_local_specialization (r, t);
DECL_CHAIN (r) = NULL_TREE;
......@@ -12481,6 +12479,11 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}
else
{
/* This can happen for a variable used in a late-specified
return type of a local lambda. Just make a dummy decl
since it's only used for its type. */
if (cp_unevaluated_operand)
return tsubst_decl (t, args, complain);
gcc_assert (errorcount || sorrycount);
return error_mark_node;
}
......
// PR c++/59791
// We force the gimple dump to trigger use of lang_decl_name.
// { dg-options "-std=c++11 -fdump-tree-gimple" }
// { dg-final { cleanup-tree-dump "gimple" } }
template < class T > void
f (T t)
{
int i = t;
[](int)->decltype (i + t)
{
return 0;
}
(0);
}
void
foo ()
{
f (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment