diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -4590,15 +4590,6 @@ return ImplicitConversionSequence::Indistinguishable; } -/// Determine whether the given type is valid, e.g., it is not an invalid -/// C++ class. -static bool isTypeValid(QualType T) { - if (CXXRecordDecl *Record = T->getAsCXXRecordDecl()) - return !Record->isInvalidDecl(); - - return true; -} - static QualType withoutUnaligned(ASTContext &Ctx, QualType T) { if (!T.getQualifiers().hasUnaligned()) return T; @@ -4648,7 +4639,6 @@ if (UnqualT1 == UnqualT2) { // Nothing to do. } else if (isCompleteType(Loc, OrigT2) && - isTypeValid(UnqualT1) && isTypeValid(UnqualT2) && IsDerivedFrom(Loc, UnqualT2, UnqualT1)) Conv |= ReferenceConversions::DerivedToBase; else if (UnqualT1->isObjCObjectOrInterfaceType() &&