diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 |
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; } |