[cfe-commits] r44616 - in /cfe/trunk: Driver/RewriteTest.cpp test/Sema/objc-super-test.m
Fariborz Jahanian
fjahanian at apple.com
Wed Dec 5 09:29:46 PST 2007
Author: fjahanian
Date: Wed Dec 5 11:29:46 2007
New Revision: 44616
URL: http://llvm.org/viewvc/llvm-project?rev=44616&view=rev
Log:
Changed type-cast of "struct objc_super"'s 2nd initializer to match definition of
"struct objc_super".
Added:
cfe/trunk/test/Sema/objc-super-test.m
Modified:
cfe/trunk/Driver/RewriteTest.cpp
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=44616&r1=44615&r2=44616&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Wed Dec 5 11:29:46 2007
@@ -1337,9 +1337,9 @@
CallExpr *Cls = SynthesizeCallToFunctionDecl(GetClassFunctionDecl,
&ClsExprs[0],
ClsExprs.size());
- // To turn off a warning, type-cast to 'Class'
+ // To turn off a warning, type-cast to 'id'
InitExprs.push_back(
- new CastExpr(Context->getObjcClassType(),
+ new CastExpr(Context->getObjcIdType(),
Cls, SourceLocation())); // set 'super class', using objc_getClass().
// struct objc_super
QualType superType = getSuperStructType();
Added: cfe/trunk/test/Sema/objc-super-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/objc-super-test.m?rev=44616&view=auto
==============================================================================
--- cfe/trunk/test/Sema/objc-super-test.m (added)
+++ cfe/trunk/test/Sema/objc-super-test.m Wed Dec 5 11:29:46 2007
@@ -0,0 +1,17 @@
+// RUN: clang -rewrite-test %s | clang
+
+#include <objc/objc.h>
+
+ at interface SUPER
+- (int) MainMethod;
+ at end
+
+ at interface MyDerived : SUPER
+- (int) instanceMethod;
+ at end
+
+ at implementation MyDerived
+- (int) instanceMethod {
+ return [super MainMethod];
+}
+ at end
More information about the cfe-commits
mailing list