diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 356f3d6f52b5..3adf9e0a1aba 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -218,7 +218,8 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr) /* If BASE is incomplete, it can't be a base of T--and instantiating it might cause an error. */ - if (t_binfo && (COMPLETE_TYPE_P (base) || TYPE_BEING_DEFINED (base))) + if (t_binfo && CLASS_TYPE_P (base) + && (COMPLETE_TYPE_P (base) || TYPE_BEING_DEFINED (base))) { struct lookup_base_data_s data;