diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-12-01 01:07:24 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-12-01 01:07:24 +0000 |
| commit | 68500913ece9def8f11649fed41713d50e94728d (patch) | |
| tree | 9b8b02fad900cd3b99dabfe01b73c20ff50875b3 /clang/test/SemaObjC | |
| parent | ce81496fab8cea588631dded376a88de347c58f0 (diff) | |
| download | bcm5719-llvm-68500913ece9def8f11649fed41713d50e94728d.tar.gz bcm5719-llvm-68500913ece9def8f11649fed41713d50e94728d.zip | |
When unknown method is sent to a receiver of
'Class' type, disgnostic should refere to a
class method. Fixes // rdar://8592156
llvm-svn: 120517
Diffstat (limited to 'clang/test/SemaObjC')
| -rw-r--r-- | clang/test/SemaObjC/call-super-2.m | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/class-method-lookup.m | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/method-lookup-5.m | 10 | ||||
| -rw-r--r-- | clang/test/SemaObjC/method-lookup.m | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/clang/test/SemaObjC/call-super-2.m b/clang/test/SemaObjC/call-super-2.m index 043314d4e18..84a625c404e 100644 --- a/clang/test/SemaObjC/call-super-2.m +++ b/clang/test/SemaObjC/call-super-2.m @@ -35,7 +35,7 @@ id objc_getClass(const char *s); @implementation Derived + (int) class_func1 { - int i = (size_t)[self class_func0]; // expected-warning {{method '-class_func0' not found (return type defaults to 'id')}} + int i = (size_t)[self class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}} return i + (size_t)[super class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}} } + (int) class_func2 diff --git a/clang/test/SemaObjC/class-method-lookup.m b/clang/test/SemaObjC/class-method-lookup.m index f26d692328a..8c8c21682f1 100644 --- a/clang/test/SemaObjC/class-method-lookup.m +++ b/clang/test/SemaObjC/class-method-lookup.m @@ -20,7 +20,7 @@ [self rootInstanceMethod]; /* class is searched for an instance method */ [MyIntermediate rootInstanceMethod]; /* with the same name. */ - [self instanceMethod];// expected-warning {{'-instanceMethod' not found (return type defaults to 'id')}} + [self instanceMethod];// expected-warning {{'+instanceMethod' not found (return type defaults to 'id')}} [MyDerived instanceMethod];// expected-warning {{'+instanceMethod' not found (return type defaults to 'id')}} } @end diff --git a/clang/test/SemaObjC/method-lookup-5.m b/clang/test/SemaObjC/method-lookup-5.m new file mode 100644 index 00000000000..13df218144c --- /dev/null +++ b/clang/test/SemaObjC/method-lookup-5.m @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// rdar://8592156 + +typedef struct objc_class *Class; +@interface A +-(Class) foo; +@end + +void f0(A *a) { int x = [[a foo] baz]; } // expected-warning {{method '+baz' not found (return type defaults to 'id')}} \ + // expected-warning {{ncompatible pointer to integer conversion initializing 'int' with an expression of type 'id'}} diff --git a/clang/test/SemaObjC/method-lookup.m b/clang/test/SemaObjC/method-lookup.m index e3789584bf5..3091124e66a 100644 --- a/clang/test/SemaObjC/method-lookup.m +++ b/clang/test/SemaObjC/method-lookup.m @@ -22,7 +22,7 @@ typedef int NSInteger; static NSMutableArray * recentCompletions = ((void *)0); + (float) factorForRecentCompletion:(NSString *) completion { - for (NSObject<PBXCompletionItem> * item in [self completionItems]) // expected-warning{{method '-completionItems' not found (return type defaults to 'id')}} + for (NSObject<PBXCompletionItem> * item in [self completionItems]) // expected-warning{{method '+completionItems' not found (return type defaults to 'id')}} { if ([item respondsToSelector:@selector(setPriority:)]) { |

