diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-06-04 21:38:52 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-06-04 21:38:52 +0000 |
| commit | 524fbe8687bddab6decf6ad58ccd790570c8550f (patch) | |
| tree | b7b98094ce5e95faed8ce22a22c1d9078a1b3b43 /clang | |
| parent | 21979193bbbcda052611f76ba906bbd0c885c8f5 (diff) | |
| download | bcm5719-llvm-524fbe8687bddab6decf6ad58ccd790570c8550f.tar.gz bcm5719-llvm-524fbe8687bddab6decf6ad58ccd790570c8550f.zip | |
Update a test and add a FIXME.
llvm-svn: 51967
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/test/Sema/objc-types-compatible.m | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/clang/test/Sema/objc-types-compatible.m b/clang/test/Sema/objc-types-compatible.m index a07962bf08b..bd8a7490c41 100644 --- a/clang/test/Sema/objc-types-compatible.m +++ b/clang/test/Sema/objc-types-compatible.m @@ -1,4 +1,4 @@ -// RUN: clang -fsyntax-only -verify %s +// RUN: clang -fsyntax-only -verify -pedantic %s typedef signed char BOOL; typedef int NSInteger; @@ -14,3 +14,27 @@ extern NSInteger codeAssistantCaseCompareItems(id a, id b, void *context); NSInteger codeAssistantCaseCompareItems(id<PBXCompletionItem> a, id<PBXCompletionItem> b, void *context) { } + +#if 0 +FIXME: clang needs to compare each method prototype with its definition (see below). + +GCC produces the following correct warnning: +[snaroff:llvm/tools/clang] snarofflocal% cc -c test/Sema/objc-types-compatible.m +test/Sema/objc-types-compatible.m: In function ‘-[TedWantsToVerifyObjCDoesTheRightThing compareThis:withThat:]’: +test/Sema/objc-types-compatible.m:26: warning: conflicting types for ‘-(id)compareThis:(id <PBXCompletionItem>)a withThat:(id <PBXCompletionItem>)b’ +test/Sema/objc-types-compatible.m:20: warning: previous declaration of ‘-(id)compareThis:(int)a withThat:(id)b’ +#endif + +@interface TedWantsToVerifyObjCDoesTheRightThing + +- compareThis:(int)a withThat:(id)b; + +@end + +@implementation TedWantsToVerifyObjCDoesTheRightThing + +- compareThis:(id<PBXCompletionItem>)a withThat:(id<PBXCompletionItem>)b { + return self; +} + +@end |

