diff options
author | Jason Merrill <jason@redhat.com> | 2021-03-30 20:31:18 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-03-31 09:58:37 -0400 |
commit | a2531859bf5bf6cf1f29c0dca85fd26e80904a5d (patch) | |
tree | 00067cc3699817b172593356723f2d4a191b1b2e /gcc/cp | |
parent | 05de07136a8c288086def19fa7a6ed817e26c6aa (diff) | |
download | gcc-a2531859bf5bf6cf1f29c0dca85fd26e80904a5d.zip gcc-a2531859bf5bf6cf1f29c0dca85fd26e80904a5d.tar.gz gcc-a2531859bf5bf6cf1f29c0dca85fd26e80904a5d.tar.bz2 |
c++: Alias template in pack expansion [PR99445]
In this testcase, iterative_hash_template_arg checks
alias_template_specialization_p to determine whether to treat a type as a
dependent alias, and structural_comptypes checks
dependent_alias_template_spec_p. Normally that difference isn't a problem
because canonicalizing template arguments strips non-dependent aliases, but
that wasn't happening for the pack expansion. Fixed thus.
gcc/cp/ChangeLog:
PR c++/99445
* tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
gcc/testsuite/ChangeLog:
PR c++/99445
* g++.dg/cpp0x/alias-decl-variadic1.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/tree.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 8c4bd15..dca947b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1722,6 +1722,15 @@ strip_typedefs (tree t, bool *remove_attributes, unsigned int flags) remove_attributes, 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; + } + break; default: break; } |