Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115683 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 98c676b..89ae18f 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -751,10 +751,8 @@
void Sema::WarnConflictingTypedMethods(ObjCMethodDecl *ImpMethodDecl,
ObjCMethodDecl *IntfMethodDecl) {
- if (!Context.typesAreCompatible(IntfMethodDecl->getResultType(),
- ImpMethodDecl->getResultType()) &&
- !Context.QualifiedIdConformsQualifiedId(IntfMethodDecl->getResultType(),
- ImpMethodDecl->getResultType())) {
+ if (!Context.hasSameType(IntfMethodDecl->getResultType(),
+ ImpMethodDecl->getResultType())) {
Diag(ImpMethodDecl->getLocation(), diag::warn_conflicting_ret_types)
<< ImpMethodDecl->getDeclName() << IntfMethodDecl->getResultType()
<< ImpMethodDecl->getResultType();
@@ -766,8 +764,7 @@
IM != EM; ++IM, ++IF) {
QualType ParmDeclTy = (*IF)->getType().getUnqualifiedType();
QualType ParmImpTy = (*IM)->getType().getUnqualifiedType();
- if (Context.typesAreCompatible(ParmDeclTy, ParmImpTy) ||
- Context.QualifiedIdConformsQualifiedId(ParmDeclTy, ParmImpTy))
+ if (Context.hasSameType(ParmDeclTy, ParmImpTy))
continue;
Diag((*IM)->getLocation(), diag::warn_conflicting_param_types)