Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -2398,13 +2398,6 @@ } } - -/// \brief Tests if the __interface base is public. -static bool IsBasePublicInterface(const CXXRecordDecl *RD, - AccessSpecifier spec) { - return RD->isInterface() && spec == AS_public; -} - /// \brief Performs the actual work of attaching the given base class /// specifiers to a C++ class. bool Sema::AttachBaseSpecifiers(CXXRecordDecl *Class, @@ -2457,13 +2450,13 @@ if (const RecordType *Record = NewBaseType->getAs()) { const CXXRecordDecl *RD = cast(Record->getDecl()); if (Class->isInterface() && - !IsBasePublicInterface(RD, KnownBase->getAccessSpecifier()) && + !(RD->isInterface() && + KnownBase->getAccessSpecifier() == AS_public) && // The Microsoft extension __interface does not permit bases that // are not themselves public interfaces. // An interface can inherit from a base, as long as it has // uuid attributes. - (!RD->getAttr() || - Class->hasAttrs())) { + (!RD->getAttr() || Class->hasAttrs())) { Diag(KnownBase->getLocStart(), diag::err_invalid_base_in_interface) << getRecordDiagFromTagKind(RD->getTagKind()) << RD->getName() << RD->getSourceRange();