summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-02-27 22:55:11 +0000
committerTed Kremenek <kremenek@apple.com>2012-02-27 22:55:11 +0000
commit3306ec1923973d7b5767b23ba95915af2fec87d7 (patch)
tree99cb9e6c7fe53f800ace11be098d4caf52b74490 /test
parentadfb535905a7ca4226d06a29ebc665085503afd5 (diff)
downloadclang-3306ec1923973d7b5767b23ba95915af2fec87d7.tar.gz
clang-3306ec1923973d7b5767b23ba95915af2fec87d7.tar.bz2
clang-3306ec1923973d7b5767b23ba95915af2fec87d7.tar.xz
After numerous requests, have Objective-C 'method declared here' notes mention the actual method. This looks better within an IDE, where text isn't always regurgitated in the presentation of a warning. Fixes radar 10914035.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/method-arg-decay.m5
-rw-r--r--test/SemaObjC/arc-peformselector.m8
-rw-r--r--test/SemaObjC/arc.m8
-rw-r--r--test/SemaObjC/category-1.m4
-rw-r--r--test/SemaObjC/class-message-protocol-lookup.m2
-rw-r--r--test/SemaObjC/compare-qualified-id.m4
-rw-r--r--test/SemaObjC/incomplete-implementation.m4
-rw-r--r--test/SemaObjC/method-attributes.m6
-rw-r--r--test/SemaObjC/method-undef-category-warn-1.m8
-rw-r--r--test/SemaObjC/method-undef-extension-warn-1.m4
-rw-r--r--test/SemaObjC/protocol-implementing-class-methods.m6
-rw-r--r--test/SemaObjC/related-result-type-inference.m2
-rw-r--r--test/SemaObjC/undef-protocol-methods-1.m20
-rw-r--r--test/SemaObjC/warn-deprecated-implementations.m8
14 files changed, 44 insertions, 45 deletions
diff --git a/test/Analysis/method-arg-decay.m b/test/Analysis/method-arg-decay.m
index ffe28afc4d..a36d81e82b 100644
--- a/test/Analysis/method-arg-decay.m
+++ b/test/Analysis/method-arg-decay.m
@@ -56,7 +56,7 @@ PBXFindMatchContains, PBXFindMatchStartsWith, PBXFindMatchWholeWords,
@interface PBXProjectModule : PBXModule <PBXFindableText> {
}
@end @class PBXBookmark;
-@protocol PBXSelectionTarget - (NSObject <PBXSelectionTarget> *) performAction:(id)action withSelection:(NSArray *)selection; // expected-note {{method declared here}}
+@protocol PBXSelectionTarget - (NSObject <PBXSelectionTarget> *) performAction:(id)action withSelection:(NSArray *)selection; // expected-note {{method 'performAction:withSelection:' declared here}}
@end @class XCPropertyDictionary, XCPropertyCondition, XCPropertyConditionSet, XCMutablePropertyConditionSet;
extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExposedModulesOnly);
@interface NSString (StringUtilities) - (NSString *) trimToLength:(NSInteger)length preserveRange:(NSRange)range;
@@ -72,8 +72,7 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
}
- (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}}
@end
-@implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented}}
+@implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} 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/SemaObjC/arc-peformselector.m b/test/SemaObjC/arc-peformselector.m
index c015eb8711..dec09e33ed 100644
--- a/test/SemaObjC/arc-peformselector.m
+++ b/test/SemaObjC/arc-peformselector.m
@@ -2,12 +2,12 @@
// rdar://9659270
@interface NSObject
-- (id)copy; // expected-note {{method declared here}}
-- (id) test __attribute__((ns_returns_retained)); // expected-note {{method declared here}}
-+ (id) new ; // expected-note {{method declared here}}
+- (id)copy; // expected-note {{method 'copy' declared here}}
+- (id) test __attribute__((ns_returns_retained)); // expected-note {{method 'test' declared here}}
++ (id) new ; // expected-note {{method 'new' declared here}}
- (id) init __attribute__((ns_returns_not_retained));
- (id)PlusZero;
-- (id)PlusOne __attribute__((ns_returns_retained)); // expected-note {{method declared here}}
+- (id)PlusOne __attribute__((ns_returns_retained)); // expected-note {{method 'PlusOne' declared here}}
@end
@interface I : NSObject
diff --git a/test/SemaObjC/arc.m b/test/SemaObjC/arc.m
index d9ae5b403c..a78229cf43 100644
--- a/test/SemaObjC/arc.m
+++ b/test/SemaObjC/arc.m
@@ -42,10 +42,10 @@ void test1(A *a) {
// rdar://8843638
@interface I
-- (id)retain; // expected-note {{method declared here}}
-- (id)autorelease; // expected-note {{method declared here}}
-- (oneway void)release; // expected-note {{method declared here}}
-- (NSUInteger)retainCount; // expected-note {{method declared here}}
+- (id)retain; // expected-note {{method 'retain' declared here}}
+- (id)autorelease; // expected-note {{method 'autorelease' declared here}}
+- (oneway void)release; // expected-note {{method 'release' declared here}}
+- (NSUInteger)retainCount; // expected-note {{method 'retainCount' declared here}}
@end
@implementation I
diff --git a/test/SemaObjC/category-1.m b/test/SemaObjC/category-1.m
index 7df85da500..137309f755 100644
--- a/test/SemaObjC/category-1.m
+++ b/test/SemaObjC/category-1.m
@@ -62,7 +62,7 @@
// <rdar://problem/7249233>
@protocol MultipleCat_P
--(void) im0; // expected-note {{method declared here}}
+-(void) im0; // expected-note {{method 'im0' declared here}}
@end
@interface MultipleCat_I @end // expected-note {{required for direct or indirect protocol 'MultipleCat_P'}}
@@ -72,7 +72,7 @@
@interface MultipleCat_I() <MultipleCat_P> @end
@implementation MultipleCat_I // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented}}
+ // expected-warning {{method 'im0' in protocol not implemented}}
@end
// <rdar://problem/7680391> - Handle nameless categories with no name that refer
diff --git a/test/SemaObjC/class-message-protocol-lookup.m b/test/SemaObjC/class-message-protocol-lookup.m
index ae64ea8680..944d469802 100644
--- a/test/SemaObjC/class-message-protocol-lookup.m
+++ b/test/SemaObjC/class-message-protocol-lookup.m
@@ -13,7 +13,7 @@
@protocol Test2Protocol
+ (id)alloc;
-- (id)alloc2; // expected-note 2 {{method declared here}}
+- (id)alloc2; // expected-note 2 {{method 'alloc2' declared here}}
@end
@implementation RandomObject
diff --git a/test/SemaObjC/compare-qualified-id.m b/test/SemaObjC/compare-qualified-id.m
index e195640d2b..d31dfae86e 100644
--- a/test/SemaObjC/compare-qualified-id.m
+++ b/test/SemaObjC/compare-qualified-id.m
@@ -5,7 +5,7 @@ typedef unsigned int NSUInteger;
typedef struct _NSZone NSZone;
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
@protocol NSObject - (BOOL)isEqual:(id)object; @end
-@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end // expected-note {{method declared here}}
+@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end // expected-note {{method 'copyWithZone:' declared here}}
@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end
@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
@interface NSObject <NSObject> {} @end
@@ -24,7 +24,7 @@ extern NSString * const NSTaskDidTerminateNotification;
@end
@implementation XCPropertyExpansionContext // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented}}
+ // expected-warning {{method 'copyWithZone:' in protocol not implemented}}
- (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)) { }
diff --git a/test/SemaObjC/incomplete-implementation.m b/test/SemaObjC/incomplete-implementation.m
index a79628aeed..df34a43f74 100644
--- a/test/SemaObjC/incomplete-implementation.m
+++ b/test/SemaObjC/incomplete-implementation.m
@@ -2,7 +2,7 @@
@interface I
- Meth; // expected-note{{method definition for 'Meth' not found}} \
- // expected-note{{method declared here}}
+ // expected-note{{method 'Meth' declared here}}
@end
@implementation I // expected-warning{{incomplete implementation}}
@@ -14,7 +14,7 @@
#pragma GCC diagnostic ignored "-Wincomplete-implementation"
@interface I2
-- Meth; // expected-note{{method declared here}}
+- Meth; // expected-note{{method 'Meth' declared here}}
@end
@implementation I2
diff --git a/test/SemaObjC/method-attributes.m b/test/SemaObjC/method-attributes.m
index 9a1271dd3c..b2472a46bf 100644
--- a/test/SemaObjC/method-attributes.m
+++ b/test/SemaObjC/method-attributes.m
@@ -13,9 +13,9 @@
@interface INTF
- (int) foo1: (int)arg1 __attribute__((deprecated));
-- (int) foo: (int)arg1; // expected-note {{method declared here}}
+- (int) foo: (int)arg1; // expected-note {{method 'foo:' declared here}}
-- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{method declared here}}
+- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{method 'foo2:' declared here}}
- (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self));
@end
@@ -39,7 +39,7 @@
@interface Foo
- (void)doSomething1:(id)sender;
-- (void)doSomething2:(id)sender; // expected-note {{method declared here}}
+- (void)doSomething2:(id)sender; // expected-note {{method 'doSomething2:' declared here}}
@end
@implementation Foo
diff --git a/test/SemaObjC/method-undef-category-warn-1.m b/test/SemaObjC/method-undef-category-warn-1.m
index 929f162cb9..b390827656 100644
--- a/test/SemaObjC/method-undef-category-warn-1.m
+++ b/test/SemaObjC/method-undef-category-warn-1.m
@@ -4,8 +4,8 @@
@end
@protocol P
-- (void) Pmeth; // expected-note {{method declared here}}
-- (void) Pmeth1; // expected-note {{method declared here}}
+- (void) Pmeth; // expected-note {{method 'Pmeth' declared here}}
+- (void) Pmeth1; // expected-note {{method 'Pmeth1' declared here}}
@end
@interface MyClass1(CAT) <P> // expected-note {{required for direct or indirect protocol 'P'}}
@@ -13,7 +13,7 @@
@end
@implementation MyClass1(CAT) // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented}}
+ // expected-warning {{method 'Pmeth' in protocol not implemented}}
- (void) Pmeth1{}
@end
@@ -22,7 +22,7 @@
@end
@implementation MyClass1(DOG) // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented}}
+ // expected-warning {{method 'Pmeth1' in protocol not implemented}}
- (void) Pmeth {}
@end
diff --git a/test/SemaObjC/method-undef-extension-warn-1.m b/test/SemaObjC/method-undef-extension-warn-1.m
index 9701a2e5d5..aeacee16c6 100644
--- a/test/SemaObjC/method-undef-extension-warn-1.m
+++ b/test/SemaObjC/method-undef-extension-warn-1.m
@@ -5,7 +5,7 @@
@protocol P
- (void)Pmeth;
-- (void)Pmeth1; // expected-note {{method declared here}}
+- (void)Pmeth1; // expected-note {{method 'Pmeth1' declared here}}
@end
// Class extension
@@ -19,6 +19,6 @@
@end
@implementation MyClass // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented}}
+ // expected-warning {{method 'Pmeth1' in protocol not implemented}}
- (void)Pmeth {}
@end
diff --git a/test/SemaObjC/protocol-implementing-class-methods.m b/test/SemaObjC/protocol-implementing-class-methods.m
index f08a5a97d8..503eef11ca 100644
--- a/test/SemaObjC/protocol-implementing-class-methods.m
+++ b/test/SemaObjC/protocol-implementing-class-methods.m
@@ -5,11 +5,11 @@
@optional
- (int) PMeth;
@required
-- (void) : (double) arg; // expected-note {{method declared here}}
+- (void) : (double) arg; // expected-note {{method ':' declared here}}
@end
@interface NSImage <P1>
-- (void) initialize; // expected-note {{method declared here}}
+- (void) initialize; // expected-note {{method 'initialize' declared here}}
@end
@interface NSImage (AirPortUI)
@@ -17,7 +17,7 @@
@end
@interface NSImage()
-- (void) CEMeth; // expected-note {{method declared here}}
+- (void) CEMeth; // expected-note {{method 'CEMeth' declared here}}
@end
@implementation NSImage (AirPortUI)
diff --git a/test/SemaObjC/related-result-type-inference.m b/test/SemaObjC/related-result-type-inference.m
index 11b4b9602e..addecbeeca 100644
--- a/test/SemaObjC/related-result-type-inference.m
+++ b/test/SemaObjC/related-result-type-inference.m
@@ -150,7 +150,7 @@ void test_inference() {
// <rdar://problem/9340699>
@interface G
-- (id)_ABC_init __attribute__((objc_method_family(init))); // expected-note {{method declared here}}
+- (id)_ABC_init __attribute__((objc_method_family(init))); // expected-note {{method '_ABC_init' declared here}}
@end
@interface G (Additions)
diff --git a/test/SemaObjC/undef-protocol-methods-1.m b/test/SemaObjC/undef-protocol-methods-1.m
index c685fdbcbe..70ff228946 100644
--- a/test/SemaObjC/undef-protocol-methods-1.m
+++ b/test/SemaObjC/undef-protocol-methods-1.m
@@ -1,25 +1,25 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
@protocol P1
-- (void) P1proto; // expected-note {{method declared here}}
-+ (void) ClsP1Proto; // expected-note {{method declared here}}
+- (void) P1proto; // expected-note {{method 'P1proto' declared here}}
++ (void) ClsP1Proto; // expected-note {{method 'ClsP1Proto' declared here}}
- (void) DefP1proto;
@end
@protocol P2
-- (void) P2proto; // expected-note {{method declared here}}
-+ (void) ClsP2Proto; // expected-note {{method declared here}}
+- (void) P2proto; // expected-note {{method 'P2proto' declared here}}
++ (void) ClsP2Proto; // expected-note {{method 'ClsP2Proto' declared here}}
@end
@protocol P3<P2>
-- (void) P3proto; // expected-note {{method declared here}}
-+ (void) ClsP3Proto; // expected-note {{method declared here}}
+- (void) P3proto; // expected-note {{method 'P3proto' declared here}}
++ (void) ClsP3Proto; // expected-note {{method 'ClsP3Proto' declared here}}
+ (void) DefClsP3Proto;
@end
@protocol PROTO<P1, P3>
-- (void) meth; // expected-note {{method declared here}}
-- (void) meth : (int) arg1; // expected-note {{method declared here}}
-+ (void) cls_meth : (int) arg1; // expected-note {{method declared here}}
+- (void) meth; // expected-note {{method 'meth' declared here}}
+- (void) meth : (int) arg1; // expected-note {{method 'meth:' declared here}}
++ (void) cls_meth : (int) arg1; // expected-note {{method 'cls_meth:' declared here}}
@end
@interface INTF <PROTO> // expected-note 3 {{required for direct or indirect protocol 'PROTO'}} \
@@ -29,7 +29,7 @@
@end
@implementation INTF // expected-warning {{incomplete implementation}} \
- // expected-warning 9 {{method in protocol not implemented}}
+ // expected-warning 9 {{in protocol not implemented}}
- (void) DefP1proto{}
+ (void) DefClsP3Proto{}
diff --git a/test/SemaObjC/warn-deprecated-implementations.m b/test/SemaObjC/warn-deprecated-implementations.m
index 60da7b0c41..0e116fe9f3 100644
--- a/test/SemaObjC/warn-deprecated-implementations.m
+++ b/test/SemaObjC/warn-deprecated-implementations.m
@@ -2,15 +2,15 @@
// rdar://8973810
@protocol P
-- (void) D __attribute__((deprecated)); // expected-note {{method declared here}}
+- (void) D __attribute__((deprecated)); // expected-note {{method 'D' declared here}}
@end
@interface A <P>
-+ (void)F __attribute__((deprecated)); // expected-note {{method declared here}}
++ (void)F __attribute__((deprecated)); // expected-note {{method 'F' declared here}}
@end
@interface A()
-- (void) E __attribute__((deprecated)); // expected-note {{method declared here}}
+- (void) E __attribute__((deprecated)); // expected-note {{method 'E' declared here}}
@end
@implementation A
@@ -34,7 +34,7 @@ __attribute__((deprecated))
@end
@interface BASE
-- (void) B __attribute__((deprecated)); // expected-note {{method declared here}}
+- (void) B __attribute__((deprecated)); // expected-note {{method 'B' declared here}}
@end
@interface SUB : BASE