|
@@ -417,7 +417,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
|
|
DeclarationNameInfo(SuperName, SuperLoc), LookupOrdinaryName, TUScope,
|
|
DeclarationNameInfo(SuperName, SuperLoc), LookupOrdinaryName, TUScope,
|
|
NULL, NULL, false, CTC_NoKeywords);
|
|
NULL, NULL, false, CTC_NoKeywords);
|
|
if ((PrevDecl = Corrected.getCorrectionDeclAs<ObjCInterfaceDecl>())) {
|
|
if ((PrevDecl = Corrected.getCorrectionDeclAs<ObjCInterfaceDecl>())) {
|
|
- if (PrevDecl == IDecl) {
|
|
|
|
|
|
+ if (declaresSameEntity(PrevDecl, IDecl)) {
|
|
// Don't correct to the class we're defining.
|
|
// Don't correct to the class we're defining.
|
|
PrevDecl = 0;
|
|
PrevDecl = 0;
|
|
} else {
|
|
} else {
|
|
@@ -429,7 +429,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (PrevDecl == IDecl) {
|
|
|
|
|
|
+ if (declaresSameEntity(PrevDecl, IDecl)) {
|
|
Diag(SuperLoc, diag::err_recursive_superclass)
|
|
Diag(SuperLoc, diag::err_recursive_superclass)
|
|
<< SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc);
|
|
<< SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc);
|
|
IDecl->setLocEnd(ClassLoc);
|
|
IDecl->setLocEnd(ClassLoc);
|
|
@@ -924,7 +924,7 @@ Decl *Sema::ActOnStartClassImplementation(
|
|
if (!SDecl)
|
|
if (!SDecl)
|
|
Diag(SuperClassLoc, diag::err_undef_superclass)
|
|
Diag(SuperClassLoc, diag::err_undef_superclass)
|
|
<< SuperClassname << ClassName;
|
|
<< SuperClassname << ClassName;
|
|
- else if (IDecl && IDecl->getSuperClass() != SDecl) {
|
|
|
|
|
|
+ else if (IDecl && !declaresSameEntity(IDecl->getSuperClass(), SDecl)) {
|
|
// This implementation and its interface do not have the same
|
|
// This implementation and its interface do not have the same
|
|
// super class.
|
|
// super class.
|
|
Diag(SuperClassLoc, diag::err_conflicting_super_class)
|
|
Diag(SuperClassLoc, diag::err_conflicting_super_class)
|
|
@@ -2439,7 +2439,7 @@ CheckRelatedResultTypeCompatibility(Sema &S, ObjCMethodDecl *Method,
|
|
if (ObjCInterfaceDecl *ResultClass
|
|
if (ObjCInterfaceDecl *ResultClass
|
|
= ResultObjectType->getInterfaceDecl()) {
|
|
= ResultObjectType->getInterfaceDecl()) {
|
|
// - it is the same as the method's class type, or
|
|
// - it is the same as the method's class type, or
|
|
- if (CurrentClass == ResultClass)
|
|
|
|
|
|
+ if (declaresSameEntity(CurrentClass, ResultClass))
|
|
return RTC_Compatible;
|
|
return RTC_Compatible;
|
|
|
|
|
|
// - it is a superclass of the method's class type
|
|
// - it is a superclass of the method's class type
|