diff options
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 4bb5d72b28..c45968a46f 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1177,14 +1177,18 @@ void Sema::WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method, return; } - if (!IncompleteImpl) { - Diag(ImpLoc, diag::warn_incomplete_impl); - IncompleteImpl = true; - } - if (DiagID == diag::warn_unimplemented_protocol_method) - Diag(ImpLoc, DiagID) << method->getDeclName(); - else - Diag(method->getLocation(), DiagID) << method->getDeclName(); + // FIXME: For now ignore 'IncompleteImpl'. + // Previously we grouped all unimplemented methods under a single + // warning, but some users strongly voiced that they would prefer + // separate warnings. We will give that approach a try, as that + // matches what we do with protocols. + + Diag(ImpLoc, DiagID) << method->getDeclName(); + + // Issue a note to the original declaration. + SourceLocation MethodLoc = method->getLocStart(); + if (MethodLoc.isValid()) + Diag(MethodLoc, diag::note_method_declared_at) << method; } /// Determines if type B can be substituted for type A. Returns true if we can @@ -1628,8 +1632,6 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, if (Diags.getDiagnosticLevel(DIAG, ImpLoc) != DiagnosticsEngine::Ignored) { WarnUndefinedMethod(ImpLoc, method, IncompleteImpl, DIAG); - Diag(method->getLocation(), diag::note_method_declared_at) - << method->getDeclName(); Diag(CDecl->getLocation(), diag::note_required_for_protocol_at) << PDecl->getDeclName(); } @@ -1651,8 +1653,6 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, if (Diags.getDiagnosticLevel(DIAG, ImpLoc) != DiagnosticsEngine::Ignored) { WarnUndefinedMethod(ImpLoc, method, IncompleteImpl, DIAG); - Diag(method->getLocation(), diag::note_method_declared_at) - << method->getDeclName(); Diag(IDecl->getLocation(), diag::note_required_for_protocol_at) << PDecl->getDeclName(); } @@ -1687,7 +1687,7 @@ void Sema::MatchAllMethodDeclarations(const SelectorSet &InsMap, !InsMap.count((*I)->getSelector())) { if (ImmediateClass) WarnUndefinedMethod(IMPDecl->getLocation(), *I, IncompleteImpl, - diag::note_undef_method_impl); + diag::warn_undef_method_impl); continue; } else { ObjCMethodDecl *ImpMethodDecl = @@ -1717,7 +1717,7 @@ void Sema::MatchAllMethodDeclarations(const SelectorSet &InsMap, if (!ClsMap.count((*I)->getSelector())) { if (ImmediateClass) WarnUndefinedMethod(IMPDecl->getLocation(), *I, IncompleteImpl, - diag::note_undef_method_impl); + diag::warn_undef_method_impl); } else { ObjCMethodDecl *ImpMethodDecl = IMPDecl->getClassMethod((*I)->getSelector()); |