From 8b43d2b0ea2d72b53a10f38903b176e58cb93b9c Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 27 Mar 2013 00:02:21 +0000 Subject: [PATCH] Split "incomplete implementation" warnings for ObjC into separate warnings. Previously all unimplemented methods for a class were grouped under a single warning, with all the unimplemented methods mentioned as notes. Based on feedback from users, most users would like a separate warning for each method, with a note pointing back to the original method declaration. Implements git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178097 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 3 +- lib/Sema/SemaDeclObjC.cpp | 28 +++++++++---------- test/Analysis/PR3991.m | 17 +++++------ test/Analysis/method-arg-decay.m | 6 ++-- test/Analysis/pr4209.m | 8 +++--- test/SemaObjC/category-1.m | 3 +- test/SemaObjC/compare-qualified-id.m | 3 +- test/SemaObjC/conditional-expr.m | 4 +-- .../forward-protocol-incomplete-impl-warn.m | 1 - test/SemaObjC/gcc-cast-ext.m | 7 +++-- test/SemaObjC/incomplete-implementation.m | 5 ++-- test/SemaObjC/method-undef-category-warn-1.m | 16 +++++------ test/SemaObjC/method-undef-extension-warn-1.m | 6 ++-- test/SemaObjC/method-undefined-warn-1.m | 20 +++++++------ test/SemaObjC/no-protocol-option-tests.m | 4 +-- test/SemaObjC/property-in-class-extension.m | 7 +++-- test/SemaObjC/undef-protocol-methods-1.m | 5 +--- test/SemaObjC/warning-missing-selector-name.m | 4 +-- 18 files changed, 73 insertions(+), 74 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index b93dc3294f..de761ae635 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -525,9 +525,8 @@ def err_conflicting_ivar_name : Error< "conflicting instance variable names: %0 vs %1">; def err_inconsistant_ivar_count : Error< "inconsistent number of instance variables specified">; -def warn_incomplete_impl : Warning<"incomplete implementation">, +def warn_undef_method_impl : Warning<"method definition for %0 not found">, InGroup>; -def note_undef_method_impl : Note<"method definition for %0 not found">; def note_required_for_protocol_at : Note<"required for direct or indirect protocol %0">; 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()); diff --git a/test/Analysis/PR3991.m b/test/Analysis/PR3991.m index 4d76fd347e..5f0919d6f0 100644 --- a/test/Analysis/PR3991.m +++ b/test/Analysis/PR3991.m @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s +// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 -Wno-incomplete-implementation %s +// expected-no-diagnostics //===----------------------------------------------------------------------===// // Delta-debugging produced forward declarations. @@ -32,16 +33,16 @@ typedef struct _NSZone NSZone; @protocol IHGoogleDocsAdapterDelegate - (void)googleDocsAdapter:(IHGoogleDocsAdapter*)inGoogleDocsAdapter accountVerifyIsValid:(BOOL)inIsValid error:(NSError *)inError; @end @interface IHGoogleDocsAdapter : NSObject { } -- (NSArray *)entries; // expected-note {{method definition for 'entries' not found}} +- (NSArray *)entries; @end extern Class const kGDataUseRegisteredClass ; -@interface IHGoogleDocsAdapter () - (GDataFeedDocList *)feedDocList; // expected-note {{method definition for 'feedDocList' not found}} -- (NSArray *)directoryPathComponents; // expected-note {{method definition for 'directoryPathComponents' not found}} -- (unsigned int)currentPathComponentIndex; // expected-note {{method definition for 'currentPathComponentIndex' not found}} -- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex; // expected-note {{method definition for 'setCurrentPathComponentIndex:' not found}} -- (NSURL *)folderFeedURL; // expected-note {{method definition for 'folderFeedURL' not found}} +@interface IHGoogleDocsAdapter () - (GDataFeedDocList *)feedDocList; +- (NSArray *)directoryPathComponents; +- (unsigned int)currentPathComponentIndex; +- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex; +- (NSURL *)folderFeedURL; @end -@implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject *)owner { // expected-warning {{incomplete implementation}} +@implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject *)owner { return 0; } diff --git a/test/Analysis/method-arg-decay.m b/test/Analysis/method-arg-decay.m index a36d81e82b..0af9e3e883 100644 --- a/test/Analysis/method-arg-decay.m +++ b/test/Analysis/method-arg-decay.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyzer-checker=core -verify %s +// RUN: %clang_cc1 -analyzer-checker=core -verify %s -Wno-incomplete-implementation typedef signed char BOOL; typedef int NSInteger; typedef unsigned int NSUInteger; @@ -70,9 +70,9 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos @interface XCPerspectiveModule : PBXProjectModule { // expected-note {{required for direct or indirect protocol 'PBXSelectionTarget'}} XCExtendedTabView *_perspectivesTabView; } -- (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}} +- (PBXModule *) moduleForTab:(NSTabViewItem *)item; @end -@implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} expected-warning {{method 'performAction:withSelection:' in protocol not implemented}}} +@implementation XCPerspectiveModule // expected-warning {{method 'performAction:withSelection:' in protocol not implemented}}} + (void) openForProjectDocument:(PBXProjectDocument *)projectDocument { } - (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data { diff --git a/test/Analysis/pr4209.m b/test/Analysis/pr4209.m index a5e7db51dc..29abe94441 100644 --- a/test/Analysis/pr4209.m +++ b/test/Analysis/pr4209.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-incomplete-implementation -verify %s // This test case was crashing due to how CFRefCount.cpp resolved the // ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr. @@ -47,14 +47,14 @@ CMProfileLocation; @interface GBCategoryChooserPanelController : NSWindowController { GSEbayCategory *rootCategory; } -- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories; // expected-note {{method definition for 'categoryDictionaryForCategoryID:inRootTreeCategories:' not found}} --(NSString*) categoryID; // expected-note {{method definition for 'categoryID' not found}} expected-note {{using}} +- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories; +-(NSString*) categoryID; // expected-note {{using}} @end @interface GSEbayCategory : NSObject { } - (int) categoryID; // expected-note {{also found}} - (GSEbayCategory *) parent; - (GSEbayCategory*) subcategoryWithID:(int) inID; -@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}} +@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent { return 0; } - (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories { diff --git a/test/SemaObjC/category-1.m b/test/SemaObjC/category-1.m index a7e69651ad..18b872aa8b 100644 --- a/test/SemaObjC/category-1.m +++ b/test/SemaObjC/category-1.m @@ -71,8 +71,7 @@ @interface MultipleCat_I() @end -@implementation MultipleCat_I // expected-warning {{incomplete implementation}} \ - // expected-warning {{method 'im0' in protocol not implemented}} +@implementation MultipleCat_I // expected-warning {{method 'im0' in protocol not implemented}} @end // - Handle nameless categories with no name that refer diff --git a/test/SemaObjC/compare-qualified-id.m b/test/SemaObjC/compare-qualified-id.m index d31dfae86e..82868f8a16 100644 --- a/test/SemaObjC/compare-qualified-id.m +++ b/test/SemaObjC/compare-qualified-id.m @@ -23,8 +23,7 @@ extern NSString * const NSTaskDidTerminateNotification; - (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state; @end -@implementation XCPropertyExpansionContext // expected-warning {{incomplete implementation}} \ - // expected-warning {{method 'copyWithZone:' in protocol not implemented}} +@implementation XCPropertyExpansionContext // expected-warning {{method 'copyWithZone:' in protocol not implemented}} - (NSString *)expandedValueForProperty:(NSString *)property { id cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}} if (cachedValueNode == ((void *)0)) { } diff --git a/test/SemaObjC/conditional-expr.m b/test/SemaObjC/conditional-expr.m index e0a3210deb..ec1305dbe8 100644 --- a/test/SemaObjC/conditional-expr.m +++ b/test/SemaObjC/conditional-expr.m @@ -21,10 +21,10 @@ @end @interface DTFilterOutputStream2 -- nextOutputStream; // expected-note {{method definition for 'nextOutputStream' not found}} +- nextOutputStream; // expected-note {{method 'nextOutputStream' declared here}} @end -@implementation DTFilterOutputStream2 // expected-warning {{incomplete implementation}} +@implementation DTFilterOutputStream2 // expected-warning {{method definition for 'nextOutputStream' not found}} - (id)initWithNextOutputStream:(id ) outputStream { id nextOutputStream = [self nextOutputStream]; self = nextOutputStream; // expected-warning {{assigning to 'DTFilterOutputStream2 *' from incompatible type 'id'}} diff --git a/test/SemaObjC/forward-protocol-incomplete-impl-warn.m b/test/SemaObjC/forward-protocol-incomplete-impl-warn.m index 1010cd75cd..01fedec3cf 100644 --- a/test/SemaObjC/forward-protocol-incomplete-impl-warn.m +++ b/test/SemaObjC/forward-protocol-incomplete-impl-warn.m @@ -16,6 +16,5 @@ @end @implementation IBImageCatalogDocument // expected-warning {{auto property synthesis will not synthesize property declared in a protocol}} \ - // expected-warning {{incomplete implementation}} \ // expected-warning {{method 'invalidate' in protocol not implemented}} @end diff --git a/test/SemaObjC/gcc-cast-ext.m b/test/SemaObjC/gcc-cast-ext.m index 30e0dce4bd..5858393b41 100644 --- a/test/SemaObjC/gcc-cast-ext.m +++ b/test/SemaObjC/gcc-cast-ext.m @@ -5,8 +5,8 @@ typedef struct _NSRange { } NSRange; @class PBXFileReference; @interface PBXDocBookmark -+ alloc; // expected-note {{method definition for 'alloc' not found}} -- autorelease; // expected-note {{method definition for 'autorelease' not found}} ++ alloc; // expected-note {{method 'alloc' declared here}} +- autorelease; // expected-note {{method 'autorelease' declared here}} @end // GCC allows pointer expressions in integer constant expressions. @@ -14,7 +14,8 @@ struct { char control[((int)(char *)2)]; } xx; -@implementation PBXDocBookmark // expected-warning {{incomplete implementation}} +@implementation PBXDocBookmark // expected-warning {{method definition for 'autorelease' not found}}\ + // expected-warning {{method definition for 'alloc' not found}} + (id)bookmarkWithFileReference:(PBXFileReference *)fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor { diff --git a/test/SemaObjC/incomplete-implementation.m b/test/SemaObjC/incomplete-implementation.m index 69e355cb9a..4b8d600cb8 100644 --- a/test/SemaObjC/incomplete-implementation.m +++ b/test/SemaObjC/incomplete-implementation.m @@ -1,13 +1,12 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s @interface I -- Meth; // expected-note{{method definition for 'Meth' not found}} \ - // expected-note{{method 'Meth' declared here}} +- Meth; // expected-note 2 {{method 'Meth' declared here}} - unavailableMeth __attribute__((availability(macosx,unavailable))); - unavailableMeth2 __attribute__((unavailable)); @end -@implementation I // expected-warning{{incomplete implementation}} +@implementation I // expected-warning {{method definition for 'Meth' not found}} @end @implementation I(CAT) diff --git a/test/SemaObjC/method-undef-category-warn-1.m b/test/SemaObjC/method-undef-category-warn-1.m index 2548cbd241..98d732babb 100644 --- a/test/SemaObjC/method-undef-category-warn-1.m +++ b/test/SemaObjC/method-undef-category-warn-1.m @@ -4,25 +4,25 @@ @end @protocol P -- (void) Pmeth; // expected-note {{method 'Pmeth' declared here}} -- (void) Pmeth1; // expected-note {{method 'Pmeth1' declared here}} +- (void) Pmeth; // expected-note {{method 'Pmeth' declared here}} +- (void) Pmeth1; // expected-note {{method 'Pmeth1' declared here}} @end @interface MyClass1(CAT)

// expected-note {{required for direct or indirect protocol 'P'}} -- (void) meth2; // expected-note {{method definition for 'meth2' not found}} +- (void) meth2; // expected-note {{method 'meth2' declared here}} @end -@implementation MyClass1(CAT) // expected-warning {{incomplete implementation}} \ - // expected-warning {{method 'Pmeth' in protocol not implemented}} +@implementation MyClass1(CAT) // expected-warning {{method 'Pmeth' in protocol not implemented}} \ + // expected-warning {{method definition for 'meth2' not found}} - (void) Pmeth1{} @end @interface MyClass1(DOG)

// expected-note {{required for direct or indirect protocol 'P'}} -- (void)ppp; // expected-note {{method definition for 'ppp' not found}} +- (void)ppp; // expected-note {{method 'ppp' declared here}} @end -@implementation MyClass1(DOG) // expected-warning {{incomplete implementation}} \ - // expected-warning {{method 'Pmeth1' in protocol not implemented}} +@implementation MyClass1(DOG) // expected-warning {{method 'Pmeth1' in protocol not implemented}} \ + // expected-warning {{method definition for 'ppp' not found}} - (void) Pmeth {} @end diff --git a/test/SemaObjC/method-undef-extension-warn-1.m b/test/SemaObjC/method-undef-extension-warn-1.m index c092f24828..fbc21bd39f 100644 --- a/test/SemaObjC/method-undef-extension-warn-1.m +++ b/test/SemaObjC/method-undef-extension-warn-1.m @@ -10,7 +10,7 @@ // Class extension @interface MyClass ()

-- (void)meth2; // expected-note {{method definition for 'meth2' not found}} +- (void)meth2; // expected-note {{method 'meth2' declared here}} @end // Add a category to test that clang does not emit warning for this method. @@ -18,7 +18,7 @@ - (void)categoryMethod; @end -@implementation MyClass // expected-warning {{incomplete implementation}} \ - // expected-warning {{method 'Pmeth1' in protocol not implemented}} +@implementation MyClass // expected-warning {{method 'Pmeth1' in protocol not implemented}} \ + // expected-warning {{method definition for 'meth2' not found}} - (void)Pmeth {} @end diff --git a/test/SemaObjC/method-undefined-warn-1.m b/test/SemaObjC/method-undefined-warn-1.m index 27d645e73b..e22140d446 100644 --- a/test/SemaObjC/method-undefined-warn-1.m +++ b/test/SemaObjC/method-undefined-warn-1.m @@ -3,12 +3,14 @@ @interface INTF - (void) meth; - (void) meth : (int) arg1; -- (int) int_meth; // expected-note {{method definition for 'int_meth' not found}} -+ (int) cls_meth; // expected-note {{method definition for 'cls_meth' not found}} -+ (void) cls_meth1 : (int) arg1; // expected-note {{method definition for 'cls_meth1:' not found}} +- (int) int_meth; // expected-note {{method 'int_meth' declared here}} ++ (int) cls_meth; // expected-note {{method 'cls_meth' declared here}} ++ (void) cls_meth1 : (int) arg1; // expected-note {{method 'cls_meth1:' declared here}} @end -@implementation INTF // expected-warning {{incomplete implementation}} +@implementation INTF // expected-warning {{method definition for 'int_meth' not found}} \ + // expected-warning {{method definition for 'cls_meth' not found}} \ + // expected-warning {{method definition for 'cls_meth1:' not found}} - (void) meth {} - (void) meth : (int) arg2{} - (void) cls_meth1 : (int) arg2{} @@ -17,12 +19,14 @@ @interface INTF1 - (void) meth; - (void) meth : (int) arg1; -- (int) int_meth; // expected-note {{method definition for 'int_meth' not found}} -+ (int) cls_meth; // expected-note {{method definition for 'cls_meth' not found}} -+ (void) cls_meth1 : (int) arg1; // expected-note {{method definition for 'cls_meth1:' not found}} +- (int) int_meth; // expected-note {{method 'int_meth' declared here}} ++ (int) cls_meth; // expected-note {{method 'cls_meth' declared here}} ++ (void) cls_meth1 : (int) arg1; // expected-note {{method 'cls_meth1:' declared here}} @end -@implementation INTF1 // expected-warning {{incomplete implementation}} +@implementation INTF1 // expected-warning {{method definition for 'int_meth' not found}} \ + // expected-warning {{method definition for 'cls_meth' not found}} \ + // expected-warning {{method definition for 'cls_meth1:' not found}} - (void) meth {} - (void) meth : (int) arg2{} - (void) cls_meth1 : (int) arg2{} diff --git a/test/SemaObjC/no-protocol-option-tests.m b/test/SemaObjC/no-protocol-option-tests.m index dbd2a14e91..605cf9f1bf 100644 --- a/test/SemaObjC/no-protocol-option-tests.m +++ b/test/SemaObjC/no-protocol-option-tests.m @@ -17,9 +17,9 @@ // Test2 @interface super - PMeth; @end @interface J : super

-- PMeth; // expected-note {{method definition for 'PMeth' not found}} +- PMeth; // expected-note {{method 'PMeth' declared here}} @end -@implementation J @end // expected-warning {{incomplete implementation}} +@implementation J @end // expected-warning {{method definition for 'PMeth' not found}} // Test3 @interface K : super

diff --git a/test/SemaObjC/property-in-class-extension.m b/test/SemaObjC/property-in-class-extension.m index a7b5130752..022a487ec6 100644 --- a/test/SemaObjC/property-in-class-extension.m +++ b/test/SemaObjC/property-in-class-extension.m @@ -37,11 +37,12 @@ void FUNC () { @interface rdar8747333 () - (NSObject *)bam; -- (NSObject *)warn; // expected-note {{method definition for 'warn' not found}} -- (void)setWarn : (NSObject *)val; // expected-note {{method definition for 'setWarn:' not found}} +- (NSObject *)warn; // expected-note {{method 'warn' declared here}} +- (void)setWarn : (NSObject *)val; // expected-note {{method 'setWarn:' declared here}} @end -@implementation rdar8747333 // expected-warning {{incomplete implementation}} +@implementation rdar8747333 // expected-warning {{method definition for 'warn' not found}} \ + // expected-warning {{method definition for 'setWarn:' not found}} @synthesize bar = _bar; @synthesize baz = _baz; @synthesize bam = _bam; diff --git a/test/SemaObjC/undef-protocol-methods-1.m b/test/SemaObjC/undef-protocol-methods-1.m index 15ba1a1eb2..25b1dadb7c 100644 --- a/test/SemaObjC/undef-protocol-methods-1.m +++ b/test/SemaObjC/undef-protocol-methods-1.m @@ -28,10 +28,7 @@ // expected-note 2 {{required for direct or indirect protocol 'P2'}} @end -@implementation INTF // expected-warning {{incomplete implementation}} \ - // expected-warning 9 {{in protocol not implemented}} +@implementation INTF // expected-warning 9 {{in protocol not implemented}} - (void) DefP1proto{} - + (void) DefClsP3Proto{} - @end diff --git a/test/SemaObjC/warning-missing-selector-name.m b/test/SemaObjC/warning-missing-selector-name.m index d43031eee0..a335e0266a 100644 --- a/test/SemaObjC/warning-missing-selector-name.m +++ b/test/SemaObjC/warning-missing-selector-name.m @@ -15,11 +15,11 @@ - method:(id) second:(id)second; // expected-warning {{'second' used as the name of the previous parameter rather than as part of the selector}} \ // expected-note {{introduce a parameter name to make 'second' part of the selector}} \ // expected-note {{or insert whitespace before ':' to use 'second' as parameter name and have an empty entry in the selector}} \ - // expected-note {{method definition for 'method::' not found}} + // expected-note {{method 'method::' declared here}} @end -@implementation INTF // expected-warning {{incomplete implementation}} +@implementation INTF // expected-warning {{method definition for 'method::' not found}} -(void) Name1:(id)Arg1 Name2:(id)Arg2{} -(void) Name1:(id) Name2:(id)Arg2 {} // expected-warning {{'Name2' used as the name of the previous parameter rather than as part of the selector}} \ // expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \ -- 2.40.0