@@ -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;
new file mode 100644
@@ -0,0 +1,6 @@
+// PR c++/100372
+// { dg-do compile { target c++14 } }
+
+template <bool> using enable_if_t = int;
+template <class> bool has_P_match_v;
+template <template <class> class... List> enable_if_t<has_P_match_v<List...>> a;