aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-01-31 12:41:24 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-01-31 12:41:24 -0500
commit2297ab7d840966f62a70328244f4c8560d388e0a (patch)
tree9d4e6bb2fb6ca1073a2a491825302c6b14eca5d9 /gcc/cp/pt.c
parent4277cddae36313ebb549ea110c7ee3eb7e62a342 (diff)
downloadgcc-2297ab7d840966f62a70328244f4c8560d388e0a.zip
gcc-2297ab7d840966f62a70328244f4c8560d388e0a.tar.gz
gcc-2297ab7d840966f62a70328244f4c8560d388e0a.tar.bz2
re PR c++/52043 ([C++0x] ICE: SIGSEGV in tsubst_copy (pt.c:12081) with -Wreturn-type)
PR c++/52043 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New. * pt.c (make_pack_expansion, tsubst_initializer_list): Set it. (tsubst_pack_expansion): Check it. From-SVN: r183768
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ad2b4df..4c93b31 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3238,6 +3238,8 @@ make_pack_expansion (tree arg)
}
PACK_EXPANSION_PARAMETER_PACKS (result) = parameter_packs;
+ PACK_EXPANSION_LOCAL_P (result) = at_function_scope_p ();
+
return result;
}
@@ -9340,7 +9342,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
}
if (TREE_CODE (parm_pack) == PARM_DECL)
{
- if (at_function_scope_p ())
+ if (PACK_EXPANSION_LOCAL_P (t))
arg_pack = retrieve_local_specialization (parm_pack);
else
{
@@ -18905,6 +18907,7 @@ tsubst_initializer_list (tree t, tree argvec)
/* Build a dummy EXPR_PACK_EXPANSION that will be used to
expand each argument in the TREE_VALUE of t. */
expr = make_node (EXPR_PACK_EXPANSION);
+ PACK_EXPANSION_LOCAL_P (expr) = true;
PACK_EXPANSION_PARAMETER_PACKS (expr) =
PACK_EXPANSION_PARAMETER_PACKS (TREE_PURPOSE (t));