[cfe-commits] r51967 - /cfe/trunk/test/Sema/objc-types-compatible.m
Steve Naroff
snaroff at apple.com
Wed Jun 4 14:38:52 PDT 2008
Author: snaroff
Date: Wed Jun 4 16:38:52 2008
New Revision: 51967
URL: http://llvm.org/viewvc/llvm-project?rev=51967&view=rev
Log:
Update a test and add a FIXME.
Modified:
cfe/trunk/test/Sema/objc-types-compatible.m
Modified: cfe/trunk/test/Sema/objc-types-compatible.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/objc-types-compatible.m?rev=51967&r1=51966&r2=51967&view=diff
==============================================================================
--- cfe/trunk/test/Sema/objc-types-compatible.m (original)
+++ cfe/trunk/test/Sema/objc-types-compatible.m Wed Jun 4 16:38:52 2008
@@ -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 @@
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
+
+ at interface TedWantsToVerifyObjCDoesTheRightThing
+
+- compareThis:(int)a withThat:(id)b;
+
+ at end
+
+ at implementation TedWantsToVerifyObjCDoesTheRightThing
+
+- compareThis:(id<PBXCompletionItem>)a withThat:(id<PBXCompletionItem>)b {
+ return self;
+}
+
+ at end
More information about the cfe-commits
mailing list