aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-01-28 23:10:58 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-01-28 23:10:58 -0500
commit15b31f8c7e139e3799cba19e61c636eb4b3fccc1 (patch)
treec2e12869d14f8b4b0ca587d5dbb253215c42e7bf /gcc/cp
parent52c02a46e8d75ada1b6487c94f2d445521c87d03 (diff)
downloadgcc-15b31f8c7e139e3799cba19e61c636eb4b3fccc1.zip
gcc-15b31f8c7e139e3799cba19e61c636eb4b3fccc1.tar.gz
gcc-15b31f8c7e139e3799cba19e61c636eb4b3fccc1.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 502f218..31217e7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
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.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 011db2c..7f1b6d5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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;
}