diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 0c5569caff00..7da37affdc1e 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -828,9 +828,10 @@ void Sema::WarnConflictingTypedMethods(ObjCMethodDecl *ImpMethodDecl, for (ObjCMethodDecl::param_iterator IM = ImpMethodDecl->param_begin(), IF = IntfMethodDecl->param_begin(), EM = ImpMethodDecl->param_end(); IM != EM; ++IM, ++IF) { - if (Context.typesAreCompatible((*IF)->getType(), (*IM)->getType()) || - Context.QualifiedIdConformsQualifiedId((*IF)->getType(), - (*IM)->getType())) + QualType ParmDeclTy = (*IF)->getType().getUnqualifiedType(); + QualType ParmImpTy = (*IM)->getType().getUnqualifiedType(); + if (Context.typesAreCompatible(ParmDeclTy, ParmImpTy) || + Context.QualifiedIdConformsQualifiedId(ParmDeclTy, ParmImpTy)) continue; Diag((*IM)->getLocation(), diag::warn_conflicting_param_types) diff --git a/clang/test/SemaObjC/no-warn-qual-mismatch.m b/clang/test/SemaObjC/no-warn-qual-mismatch.m new file mode 100644 index 000000000000..3bd4dba545f5 --- /dev/null +++ b/clang/test/SemaObjC/no-warn-qual-mismatch.m @@ -0,0 +1,16 @@ +// RUN: clang-cc -fsyntax-only -verify %s +// radar 7211563 + +@interface X + ++ (void)prototypeWithScalar:(int)aParameter; ++ (void)prototypeWithPointer:(void *)aParameter; + +@end + +@implementation X + ++ (void)prototypeWithScalar:(const int)aParameter {} ++ (void)prototypeWithPointer:(void * const)aParameter {} + +@end