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 | 9dc22e6df050b02e035b4390c70697fe45e9d010 (patch) | |
tree | 3276f6c7711c095ef804c530b1da2e5de3cd2445 | |
parent | 8b27704d61be128bbff6352e6ef417efc0d6bf4f (diff) |
Update a test and add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51967 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Sema/objc-types-compatible.m | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/Sema/objc-types-compatible.m b/test/Sema/objc-types-compatible.m index a07962bf08..bd8a7490c4 100644 --- a/test/Sema/objc-types-compatible.m +++ b/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 |