aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-05-18 17:12:37 -0400
committerJason Merrill <jason@redhat.com>2021-05-18 20:26:28 -0400
commit061fe8c58ac4d436906a404f7fb46b0a6e0d7b4f (patch)
treeaaa69ab4a54696356145344f84aa6f08c550d006 /gcc/cp
parenta8daf9a19a5eae6b98acede14bb6c27b2e0038e0 (diff)
downloadgcc-061fe8c58ac4d436906a404f7fb46b0a6e0d7b4f.zip
gcc-061fe8c58ac4d436906a404f7fb46b0a6e0d7b4f.tar.gz
gcc-061fe8c58ac4d436906a404f7fb46b0a6e0d7b4f.tar.bz2
c++: template template parm pack expansion [PR100372]
Here we have a pack expansion of a template template parameter pack, of which the pattern is a TEMPLATE_DECL, which strip_typedefs doesn't want to see. PR c++/100372 gcc/cp/ChangeLog: * tree.c (strip_typedefs): Only look at the pattern of a TYPE_PACK_EXPANSION if it's a type. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alias-decl-ttp1.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/tree.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 35faeff..72f498f 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1741,13 +1741,18 @@ strip_typedefs (tree t, bool *remove_attributes, unsigned int flags)
result = finish_underlying_type (type);
break;
case TYPE_PACK_EXPANSION:
- type = strip_typedefs (PACK_EXPANSION_PATTERN (t),
- remove_attributes, flags);
- if (type != PACK_EXPANSION_PATTERN (t))
- {
- result = copy_node (t);
- PACK_EXPANSION_PATTERN (result) = type;
- }
+ {
+ tree pat = PACK_EXPANSION_PATTERN (t);
+ if (TYPE_P (pat))
+ {
+ type = strip_typedefs (pat, remove_attributes, flags);
+ if (type != pat)
+ {
+ result = copy_node (t);
+ PACK_EXPANSION_PATTERN (result) = type;
+ }
+ }
+ }
break;
default:
break;