aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-03-25 11:26:06 -0400
committerJason Merrill <jason@redhat.com>2022-03-28 09:35:58 -0400
commit07be8f8da4c6840a1fd6b2229b147e50cc6f03dc (patch)
treed457edb5536dfaef5bffa78a4eb98cafe9bc3e91 /gcc/cp
parent52f42dce15f036a140154aa339fa1709c5cc858b (diff)
downloadgcc-07be8f8da4c6840a1fd6b2229b147e50cc6f03dc.zip
gcc-07be8f8da4c6840a1fd6b2229b147e50cc6f03dc.tar.gz
gcc-07be8f8da4c6840a1fd6b2229b147e50cc6f03dc.tar.bz2
c++: ICE with alias in pack expansion [PR103769]
This was breaking because when we stripped the 't' typedef in s<t<Args>...> to be s<Args...>, the TYPE_MAIN_VARIANT of "Args..." was still "t<Args>...", because type pack expansions are treated as types. Fixed by using the right function to copy a "type". PR c++/99445 PR c++/103769 gcc/cp/ChangeLog: * tree.cc (strip_typedefs): Use build_distinct_type_copy. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic-alias5.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/tree.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index eb59e56..4929217 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -1791,7 +1791,7 @@ strip_typedefs (tree t, bool *remove_attributes, unsigned int flags)
Ts pack, resulting in an error. */
if (type != pat && uses_parameter_packs (type))
{
- result = copy_node (t);
+ result = build_distinct_type_copy (t);
PACK_EXPANSION_PATTERN (result) = type;
}
}