@@ -4069,10 +4069,14 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
case TAG_DEFN:
t = TREE_TYPE (t);
if (CLASS_TYPE_P (t))
- /* Local class, need to look through the whole definition. */
- for (tree bb : BINFO_BASE_BINFOS (TYPE_BINFO (t)))
- cp_walk_tree (&BINFO_TYPE (bb), &find_parameter_packs_r,
- ppd, ppd->visited);
+ {
+ /* Local class, need to look through the whole definition.
+ TYPE_BINFO might be unset for a partial instantiation. */
+ if (TYPE_BINFO (t))
+ for (tree bb : BINFO_BASE_BINFOS (TYPE_BINFO (t)))
+ cp_walk_tree (&BINFO_TYPE (bb), &find_parameter_packs_r,
+ ppd, ppd->visited);
+ }
else
/* Enum, look at the values. */
for (tree l = TYPE_VALUES (t); l; l = TREE_CHAIN (l))
new file mode 100644
@@ -0,0 +1,13 @@
+// PR c++/109241
+// { dg-do compile { target c++14 } }
+// { dg-options "" } no pedantic
+
+void g() {
+ [](auto) {
+ [](auto) {
+ ({
+ struct A {};
+ });
+ };
+ }(1);
+}