summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.cc')
-rw-r--r--gcc/cp/pt.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index c7f4a95a723..79bc9c014c8 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -4106,10 +4106,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))