diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-19 23:05:46 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-19 23:05:46 +0000 |
| commit | d32967402813e489ab567c9d271804f12f1cfcaa (patch) | |
| tree | c360107ec764bda42d79186e2d79765885f4f345 /clang/test/SemaObjC | |
| parent | 1b3f3447138c3d8af3cbb7cc8ad6878a2567354b (diff) | |
| download | bcm5719-llvm-d32967402813e489ab567c9d271804f12f1cfcaa.tar.gz bcm5719-llvm-d32967402813e489ab567c9d271804f12f1cfcaa.zip | |
Objective-C qoi. When Objective-C pointer mismatches with
a qualified-id type because pointer is object of a forward
class declaration, include this info in a diagnostic note.
// rdar://10751015
llvm-svn: 211324
Diffstat (limited to 'clang/test/SemaObjC')
| -rw-r--r-- | clang/test/SemaObjC/comptypes-legal.m | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/comptypes-legal.m b/clang/test/SemaObjC/comptypes-legal.m index d83d559ee64..05f18977cc4 100644 --- a/clang/test/SemaObjC/comptypes-legal.m +++ b/clang/test/SemaObjC/comptypes-legal.m @@ -35,3 +35,20 @@ void foo(void) // Since registerFunc: expects a Derived object as it's second argument, I don't know why this would be legal. [Derived registerFunc: ExternFunc]; // expected-warning{{incompatible pointer types sending 'NSObject *(NSObject *, NSObject *)' to parameter of type 'FuncSignature *'}} } + +// rdar://10751015 +@protocol NSCopying @end +@interface I +- (void) Meth : (id <NSCopying>)aKey; // expected-note {{passing argument to parameter 'aKey' here}} +@end + +@class ForwarClass; // expected-note 3 {{conformance of forward class ForwarClass to protocol NSCopying can not be confirmed}} + +ForwarClass *Test10751015 (I* pi, ForwarClass *ns_forward) { + + [pi Meth : ns_forward ]; // expected-warning {{sending 'ForwarClass *' to parameter of incompatible type 'id<NSCopying>'}} + + id <NSCopying> id_ns = ns_forward; // expected-warning {{initializing 'id<NSCopying>' with an expression of incompatible type 'ForwarClass *'}} + + return id_ns; // expected-warning {{returning 'id<NSCopying>' from a function with incompatible result type 'ForwarClass *'}} +} |

