@@ -3576,8 +3576,12 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
*walk_subtrees = 0;
return NULL_TREE;
- case CONSTRUCTOR:
case TEMPLATE_DECL:
+ if (!DECL_TEMPLATE_TEMPLATE_PARM_P (t))
+ return NULL_TREE;
+ gcc_fallthrough();
+
+ case CONSTRUCTOR:
cp_walk_tree (&TREE_TYPE (t),
&find_parameter_packs_r, ppd, ppd->visited);
return NULL_TREE;
new file mode 100644
@@ -0,0 +1,26 @@
+// PR c++/78282
+// { dg-do compile { target c++14 } }
+
+struct null_node
+{
+ null_node(const null_node&);
+};
+
+extern null_node null;
+
+template <typename T>
+auto get() { return null; }
+
+template <typename... Ts>
+struct inheritor: Ts...
+{
+ inheritor(const inheritor& outer)
+ : Ts(get<Ts...>())...
+ { }
+};
+
+void test()
+{
+ extern inheritor<null_node> example;
+ inheritor<null_node> result(example);
+}