[cfe-commits] r99724 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclObjC.cpp test/Analysis/PR3991.m test/Analysis/pr4209.m test/SemaObjC/category-1.m test/SemaObjC/compare-qualified-id.m test/SemaObjC/conditional-expr.m test/SemaObjC/gcc-cast-ext.m test/SemaObjC/method-arg-decay.m test/SemaObjC/method-undef-category-warn-1.m test/SemaObjC/method-undef-extension-warn-1.m test/SemaObjC/method-undefined-warn-1.m test/SemaObjC/undef-protocol-methods-1.m

Fariborz Jahanian fjahanian at apple.com
Sat Mar 27 12:02:17 PDT 2010


Author: fjahanian
Date: Sat Mar 27 14:02:17 2010
New Revision: 99724

URL: http://llvm.org/viewvc/llvm-project?rev=99724&view=rev
Log:
Improve diagnostics on incomplete implementation
of objc classes; including which methods
need be implemented and where they come from.
WIP.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/test/Analysis/PR3991.m
    cfe/trunk/test/Analysis/pr4209.m
    cfe/trunk/test/SemaObjC/category-1.m
    cfe/trunk/test/SemaObjC/compare-qualified-id.m
    cfe/trunk/test/SemaObjC/conditional-expr.m
    cfe/trunk/test/SemaObjC/gcc-cast-ext.m
    cfe/trunk/test/SemaObjC/method-arg-decay.m
    cfe/trunk/test/SemaObjC/method-undef-category-warn-1.m
    cfe/trunk/test/SemaObjC/method-undef-extension-warn-1.m
    cfe/trunk/test/SemaObjC/method-undefined-warn-1.m
    cfe/trunk/test/SemaObjC/undef-protocol-methods-1.m

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat Mar 27 14:02:17 2010
@@ -275,7 +275,9 @@
 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">;
+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">;
 
 def warn_conflicting_ret_types : Warning<
   "conflicting return type in implementation of %0: %1 vs %2">;

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Sat Mar 27 14:02:17 2010
@@ -724,7 +724,8 @@
     Diag(ImpLoc, diag::warn_incomplete_impl);
     IncompleteImpl = true;
   }
-  Diag(ImpLoc, diag::warn_undef_method_impl) << method->getDeclName();
+  Diag(method->getLocation(), diag::note_undef_method_impl) 
+    << method->getDeclName();
 }
 
 void Sema::WarnConflictingTypedMethods(ObjCMethodDecl *ImpMethodDecl,
@@ -806,8 +807,11 @@
             // uses the protocol.
             ObjCMethodDecl *MethodInClass =
             IDecl->lookupInstanceMethod(method->getSelector());
-            if (!MethodInClass || !MethodInClass->isSynthesized())
+            if (!MethodInClass || !MethodInClass->isSynthesized()) {
               WarnUndefinedMethod(ImpLoc, method, IncompleteImpl);
+              Diag(IDecl->getLocation(), diag::note_required_for_protocol_at) <<
+                PDecl->getDeclName();
+            }
           }
     }
   // check unimplemented class methods
@@ -817,8 +821,11 @@
     ObjCMethodDecl *method = *I;
     if (method->getImplementationControl() != ObjCMethodDecl::Optional &&
         !ClsMap.count(method->getSelector()) &&
-        (!Super || !Super->lookupClassMethod(method->getSelector())))
+        (!Super || !Super->lookupClassMethod(method->getSelector()))) {
       WarnUndefinedMethod(ImpLoc, method, IncompleteImpl);
+      Diag(IDecl->getLocation(), diag::note_required_for_protocol_at) <<
+        PDecl->getDeclName();
+    }
   }
   // Check on this protocols's referenced protocols, recursively.
   for (ObjCProtocolDecl::protocol_iterator PI = PDecl->protocol_begin(),

Modified: cfe/trunk/test/Analysis/PR3991.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/PR3991.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/PR3991.m (original)
+++ cfe/trunk/test/Analysis/PR3991.m Sat Mar 27 14:02:17 2010
@@ -35,22 +35,16 @@
 @protocol IHGoogleDocsAdapterDelegate  - (void)googleDocsAdapter:(IHGoogleDocsAdapter*)inGoogleDocsAdapter accountVerifyIsValid:(BOOL)inIsValid error:(NSError *)inError;
 @end   @interface IHGoogleDocsAdapter : NSObject {
 }
-- (NSArray *)entries;
+- (NSArray *)entries; // expected-note {{method definition for 'entries' not found}}
 @end extern Class const kGDataUseRegisteredClass ;
- at interface IHGoogleDocsAdapter ()  - (GDataFeedDocList *)feedDocList;
-- (NSArray *)directoryPathComponents;
-- (unsigned int)currentPathComponentIndex;
-- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex;
-- (NSURL *)folderFeedURL;
+ at 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}}
 @end  
 
- at implementation IHGoogleDocsAdapter    - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner {	// expected-warning {{incomplete implementation}} \
-// expected-warning {{method definition for 'entries' not found}} \
-// expected-warning {{method definition for 'feedDocList' not found}} \
-// expected-warning {{method definition for 'directoryPathComponents' not found}} \
-// expected-warning {{method definition for 'currentPathComponentIndex' not found}} \
-// expected-warning {{method definition for 'setCurrentPathComponentIndex:' not found}} \
-// expected-warning {{method definition for 'folderFeedURL' not found}} 
+ at implementation IHGoogleDocsAdapter    - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner {	// expected-warning {{incomplete implementation}}
   return 0;
 }
 

Modified: cfe/trunk/test/Analysis/pr4209.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/pr4209.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/pr4209.m (original)
+++ cfe/trunk/test/Analysis/pr4209.m Sat Mar 27 14:02:17 2010
@@ -48,16 +48,14 @@
 @interface GBCategoryChooserPanelController : NSWindowController {
   GSEbayCategory *rootCategory;
 }
-- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories;
--(NSString*) categoryID; 
+- (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}}
 @end @interface GSEbayCategory : NSObject <NSCoding> {
 }
 - (int) categoryID;
 - (GSEbayCategory *) parent;
 - (GSEbayCategory*) subcategoryWithID:(int) inID;
- at end   @implementation GBCategoryChooserPanelController  + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories        searchRequest:(GBSearchRequest*)inRequest         parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}} \
-// expected-warning {{method definition for 'categoryDictionaryForCategoryID:inRootTreeCategories:' not found}} \
-// expected-warning {{method definition for 'categoryID' not found}}
+ at end   @implementation GBCategoryChooserPanelController  + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories        searchRequest:(GBSearchRequest*)inRequest         parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}}
   return 0;
 }
 - (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {

Modified: cfe/trunk/test/SemaObjC/category-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/category-1.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/category-1.m (original)
+++ cfe/trunk/test/SemaObjC/category-1.m Sat Mar 27 14:02:17 2010
@@ -62,16 +62,16 @@
 // <rdar://problem/7249233>
 
 @protocol MultipleCat_P
--(void) im0;
+-(void) im0; // expected-note {{method definition for 'im0' not found}}
 @end
 
- at interface MultipleCat_I @end
+ at interface MultipleCat_I @end // expected-note {{required for direct or indirect protocol 'MultipleCat_P'}}
 
 @interface MultipleCat_I()  @end
 
 @interface MultipleCat_I() <MultipleCat_P>  @end
 
- at implementation MultipleCat_I // expected-warning {{incomplete implementation}}, expected-warning {{method definition for 'im0' not found}}
+ at implementation MultipleCat_I // expected-warning {{incomplete implementation}}
 @end
 
 // <rdar://problem/7680391> - Handle nameless categories with no name that refer

Modified: cfe/trunk/test/SemaObjC/compare-qualified-id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/compare-qualified-id.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/compare-qualified-id.m (original)
+++ cfe/trunk/test/SemaObjC/compare-qualified-id.m Sat Mar 27 14:02:17 2010
@@ -5,7 +5,7 @@
 typedef struct _NSZone NSZone;
 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
 @protocol NSObject  - (BOOL)isEqual:(id)object; @end
- at protocol NSCopying  - (id)copyWithZone:(NSZone *)zone; @end
+ at protocol NSCopying  - (id)copyWithZone:(NSZone *)zone; @end // expected-note {{method definition for 'copyWithZone:' not found}}
 @protocol NSMutableCopying  - (id)mutableCopyWithZone:(NSZone *)zone; @end
 @protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder; @end
 @interface NSObject <NSObject> {} @end
@@ -15,7 +15,7 @@
 @interface NSMutableDictionary : NSDictionary  - (void)removeObjectForKey:(id)aKey; @end
 extern NSString * const NSTaskDidTerminateNotification;
 
- at interface XCPropertyExpansionContext : NSObject <NSCopying> {
+ at interface XCPropertyExpansionContext : NSObject <NSCopying> { // expected-note {{required for direct or indirect protocol 'NSCopying'}}
   NSMutableDictionary * _propNamesToPropValuesCache;
 } @end
 
@@ -23,8 +23,7 @@
 - (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state;
 @end
 
- at implementation XCPropertyExpansionContext	// expected-warning {{method definition for 'copyWithZone:' not found}} \
-						// expected-warning {{incomplete implementation}}
+ at implementation XCPropertyExpansionContext // expected-warning {{incomplete implementation}}
 - (NSString *)expandedValueForProperty:(NSString *)property {
   id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}
   if (cachedValueNode == ((void *)0)) { }

Modified: cfe/trunk/test/SemaObjC/conditional-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/conditional-expr.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/conditional-expr.m (original)
+++ cfe/trunk/test/SemaObjC/conditional-expr.m Sat Mar 27 14:02:17 2010
@@ -21,10 +21,10 @@
 @end
 
 @interface DTFilterOutputStream2
-- nextOutputStream;
+- nextOutputStream; // expected-note {{{{method definition for 'nextOutputStream' not found}}
 @end
 
- at implementation DTFilterOutputStream2 // expected-warning {{incomplete implementation}} expected-warning {{method definition for 'nextOutputStream' not found}}
+ at implementation DTFilterOutputStream2 // expected-warning {{incomplete implementation}}
 - (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
   id <DTOutputStreams> nextOutputStream = [self nextOutputStream];
   self = nextOutputStream; // expected-warning {{incompatible type assigning 'id<DTOutputStreams>', expected 'DTFilterOutputStream2 *'}}

Modified: cfe/trunk/test/SemaObjC/gcc-cast-ext.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/gcc-cast-ext.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/gcc-cast-ext.m (original)
+++ cfe/trunk/test/SemaObjC/gcc-cast-ext.m Sat Mar 27 14:02:17 2010
@@ -5,8 +5,8 @@
 @class PBXFileReference;
 
 @interface PBXDocBookmark
-+ alloc;
-- autorelease;
++ alloc;	// expected-note {{{{method definition for 'alloc' not found}}
+- autorelease;	// expected-note {{{{method definition for 'autorelease' not found}}
 @end
 
 // GCC allows pointer expressions in integer constant expressions.
@@ -14,7 +14,7 @@
   char control[((int)(char *)2)];
 } xx;
 
- at implementation PBXDocBookmark  // expected-warning {{incomplete implementation}} expected-warning {{method definition for 'autorelease' not found}} expected-warning {{method definition for 'alloc' not found}}
+ at implementation PBXDocBookmark  // expected-warning {{incomplete implementation}}
 
 + (id)bookmarkWithFileReference:(PBXFileReference *)fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor
 {

Modified: cfe/trunk/test/SemaObjC/method-arg-decay.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-arg-decay.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-arg-decay.m (original)
+++ cfe/trunk/test/SemaObjC/method-arg-decay.m Sat Mar 27 14:02:17 2010
@@ -56,7 +56,7 @@
 @interface PBXProjectModule : PBXModule <PBXFindableText> {
 }
 @end @class PBXBookmark;
- at protocol PBXSelectionTarget - (NSObject <PBXSelectionTarget> *) performAction:(id)action withSelection:(NSArray *)selection;
+ at protocol PBXSelectionTarget - (NSObject <PBXSelectionTarget> *) performAction:(id)action withSelection:(NSArray *)selection; // expected-note {{method definition for 'performAction:withSelection:' not found}}
 @end @class XCPropertyDictionary, XCPropertyCondition, XCPropertyConditionSet, XCMutablePropertyConditionSet;
 extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExposedModulesOnly);
 @interface NSString (StringUtilities) - (NSString *) trimToLength:(NSInteger)length preserveRange:(NSRange)range;
@@ -67,14 +67,12 @@
 @interface XCExtendedTabView : NSTabView <XCDockViewHeader> {
 }
 @end     @class PBXProjectDocument, PBXFileReference, PBXModule, XCWindowTool;
- at interface XCPerspectiveModule : PBXProjectModule <PBXSelectionTarget> {
+ at interface XCPerspectiveModule : PBXProjectModule <PBXSelectionTarget> { // expected-note {{required for direct or indirect protocol 'PBXSelectionTarget'}}
   XCExtendedTabView *_perspectivesTabView;
 }
-- (PBXModule *) moduleForTab:(NSTabViewItem *)item;
+- (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}}
 @end  
- at implementation XCPerspectiveModule    // expected-warning {{method definition for 'moduleForTab:' not found}}	\
-					// expected-warning {{method definition for 'performAction:withSelection:' not found}} \
-					// expected-warning {{incomplete implementation}}
+ at implementation XCPerspectiveModule // expected-warning {{incomplete implementation}}
 + (void) openForProjectDocument:(PBXProjectDocument *)projectDocument {
 }
 - (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer  matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data {

Modified: cfe/trunk/test/SemaObjC/method-undef-category-warn-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-undef-category-warn-1.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-undef-category-warn-1.m (original)
+++ cfe/trunk/test/SemaObjC/method-undef-category-warn-1.m Sat Mar 27 14:02:17 2010
@@ -1,30 +1,26 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
- at interface MyClass1 
+ at interface MyClass1  // expected-note 2 {{required for direct or indirect protocol 'P'}}
 @end
 
 @protocol P
-- (void) Pmeth;	
-- (void) Pmeth1;  
+- (void) Pmeth;	 // expected-note {{method definition for 'Pmeth' not found}}
+- (void) Pmeth1;   // expected-note {{method definition for 'Pmeth1' not found}}
 @end
 
 @interface MyClass1(CAT) <P>
-- (void) meth2;	
+- (void) meth2;	 // expected-note {{method definition for 'meth2' not found}}
 @end
 
- at implementation MyClass1(CAT) // expected-warning {{incomplete implementation}} \
-                                 expected-warning {{method definition for 'meth2' not found}} \
-                                 expected-warning {{method definition for 'Pmeth' not found}}
+ at implementation MyClass1(CAT) // expected-warning {{incomplete implementation}} 
 - (void) Pmeth1{}
 @end
 
 @interface MyClass1(DOG) <P>
-- (void)ppp;   
+- (void)ppp;    // expected-note {{method definition for 'ppp' not found}}
 @end
 
- at implementation MyClass1(DOG) // expected-warning {{incomplete implementation}} \
-                                 expected-warning {{method definition for 'ppp' not found}} \
-                                 expected-warning {{method definition for 'Pmeth1' not found}}
+ at implementation MyClass1(DOG) // expected-warning {{incomplete implementation}}
 - (void) Pmeth {}
 @end
 

Modified: cfe/trunk/test/SemaObjC/method-undef-extension-warn-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-undef-extension-warn-1.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-undef-extension-warn-1.m (original)
+++ cfe/trunk/test/SemaObjC/method-undef-extension-warn-1.m Sat Mar 27 14:02:17 2010
@@ -1,16 +1,16 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
- at interface MyClass
+ at interface MyClass // expected-note {{required for direct or indirect protocol 'P'}}
 @end
 
 @protocol P
 - (void)Pmeth;
-- (void)Pmeth1;
+- (void)Pmeth1; // expected-note {{method definition for 'Pmeth1' not found}}
 @end
 
 // Class extension
 @interface MyClass () <P>
-- (void)meth2;
+- (void)meth2; // expected-note {{method definition for 'meth2' not found}}
 @end
 
 // Add a category to test that clang does not emit warning for this method.
@@ -18,8 +18,6 @@
 - (void)categoryMethod;
 @end
 
- at implementation MyClass // expected-warning {{incomplete implementation}} \
-                           expected-warning {{method definition for 'meth2' not found}} \
-                           expected-warning {{method definition for 'Pmeth1' not found}}
+ at implementation MyClass // expected-warning {{incomplete implementation}} 
 - (void)Pmeth {}
 @end

Modified: cfe/trunk/test/SemaObjC/method-undefined-warn-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-undefined-warn-1.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-undefined-warn-1.m (original)
+++ cfe/trunk/test/SemaObjC/method-undefined-warn-1.m Sat Mar 27 14:02:17 2010
@@ -3,12 +3,12 @@
 @interface INTF
 - (void) meth;
 - (void) meth : (int) arg1;
-- (int)  int_meth; 
-+ (int) cls_meth;
-+ (void) cls_meth1 : (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}}
 @end
 
- at implementation INTF 	// expected-warning {{incomplete implementation}} 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}}
+ at implementation INTF 	// expected-warning {{incomplete implementation}}
 - (void) meth {}
 - (void) meth : (int) arg2{}
 - (void) cls_meth1 : (int) arg2{}
@@ -17,12 +17,12 @@
 @interface INTF1
 - (void) meth;
 - (void) meth : (int) arg1;
-- (int)  int_meth;      
-+ (int) cls_meth;       
-+ (void) cls_meth1 : (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}}
 @end
 
- at implementation INTF1 // expected-warning {{incomplete implementation}} 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}}
+ at implementation INTF1 // expected-warning {{incomplete implementation}}
 - (void) meth {}
 - (void) meth : (int) arg2{}
 - (void) cls_meth1 : (int) arg2{}

Modified: cfe/trunk/test/SemaObjC/undef-protocol-methods-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/undef-protocol-methods-1.m?rev=99724&r1=99723&r2=99724&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/undef-protocol-methods-1.m (original)
+++ cfe/trunk/test/SemaObjC/undef-protocol-methods-1.m Sat Mar 27 14:02:17 2010
@@ -1,40 +1,34 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
 @protocol P1
-- (void) P1proto;
-+ (void) ClsP1Proto;  
+- (void) P1proto; // expected-note {{method definition for 'P1proto' not found}}
++ (void) ClsP1Proto;   // expected-note {{method definition for 'ClsP1Proto' not found}}
 - (void) DefP1proto;
 @end
 @protocol P2
-- (void) P2proto;  
-+ (void) ClsP2Proto; 
+- (void) P2proto;   // expected-note {{method definition for 'P2proto' not found}}
++ (void) ClsP2Proto;  // expected-note {{method definition for 'ClsP2Proto' not found}}
 @end
 
 @protocol P3<P2>
-- (void) P3proto; 
-+ (void) ClsP3Proto; 
+- (void) P3proto;  // expected-note {{method definition for 'P3proto' not found}}
++ (void) ClsP3Proto;  // expected-note {{method definition for 'ClsP3Proto' not found}}
 + (void) DefClsP3Proto;
 @end
 
 @protocol PROTO<P1, P3>
-- (void) meth;		
-- (void) meth : (int) arg1; 
-+ (void) cls_meth : (int) arg1; 
- at end
-
- at interface INTF <PROTO>
- at end
-
- at implementation INTF   // expected-warning {{incomplete implementation}} \
-                          expected-warning {{method definition for 'meth' not found}} \
-                          expected-warning {{method definition for 'meth:' not found}} \
-                          expected-warning {{method definition for 'cls_meth:' not found}} \
-                          expected-warning {{method definition for 'P3proto' not found}} \
-                          expected-warning {{method definition for 'ClsP3Proto' not found}} \
-                          expected-warning {{method definition for 'P2proto' not found}} \
-                          expected-warning {{method definition for 'ClsP2Proto' not found}} \
-                          expected-warning {{method definition for 'ClsP1Proto' not found}} \
-                          expected-warning {{method definition for 'P1proto' not found}}
+- (void) meth;		 // expected-note {{method definition for 'meth' not found}}
+- (void) meth : (int) arg1;  // expected-note {{method definition for 'meth:' not found}}
++ (void) cls_meth : (int) arg1;  // expected-note {{method definition for 'cls_meth:' not found}}
+ at end
+
+ at interface INTF <PROTO> // expected-note 3 {{required for direct or indirect protocol 'PROTO'}} \
+			// expected-note 2 {{required for direct or indirect protocol 'P1'}} \
+			// expected-note 2 {{required for direct or indirect protocol 'P3'}} \
+			// expected-note 2 {{required for direct or indirect protocol 'P2'}}
+ at end
+
+ at implementation INTF   // expected-warning {{incomplete implementation}} 
 - (void) DefP1proto{}
 
 + (void) DefClsP3Proto{}





More information about the cfe-commits mailing list