@@ -2794,13 +2794,9 @@ static clang::Type const *GetCompleteEnumType(clang::ASTContext *ast,
27942794}
27952795
27962796static clang::Type const *
2797- GetCompleteObjCInterfaceType (clang::ASTContext *ast, clang::QualType qual_type,
2797+ GetCompleteObjCInterfaceType (clang::ASTContext *ast,
2798+ clang::ObjCObjectType const *objc_class_type,
27982799 bool allow_completion = true ) {
2799- const clang::ObjCObjectType *objc_class_type =
2800- llvm::dyn_cast<clang::ObjCObjectType>(qual_type);
2801- if (!objc_class_type)
2802- return nullptr ;
2803-
28042800 clang::ObjCInterfaceDecl *class_interface_decl =
28052801 objc_class_type->getInterface ();
28062802 // We currently can't complete objective C types through the newly added
@@ -2861,8 +2857,13 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
28612857 } break ;
28622858 case clang::Type::ObjCObject:
28632859 case clang::Type::ObjCInterface: {
2864- if (auto const *ty = llvm::dyn_cast_or_null<ObjCInterfaceType>(
2865- GetCompleteObjCInterfaceType (ast, qual_type, allow_completion)))
2860+ const clang::ObjCObjectType *objc_class_type =
2861+ llvm::dyn_cast<clang::ObjCObjectType>(qual_type);
2862+ if (!objc_class_type)
2863+ return true ;
2864+
2865+ if (auto const *ty = GetCompleteObjCInterfaceType (ast, objc_class_type,
2866+ allow_completion))
28662867 return TypeSystemClang::UseRedeclCompletion () || !ty->isIncompleteType ();
28672868
28682869 return false ;
0 commit comments