aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-12-05 17:29:46 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-12-05 17:29:46 +0000
commit7127431a1d1337bdf4a96cb22b4743b94f25bf61 (patch)
tree9900c5ff8258c5f4866905c5ced4227b1a75c4be
parent68e7ff8c4ef4d38d6e6800b03db0e6665481b719 (diff)
Changed type-cast of "struct objc_super"'s 2nd initializer to match definition of
"struct objc_super". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44616 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/RewriteTest.cpp4
-rw-r--r--test/Sema/objc-super-test.m17
2 files changed, 19 insertions, 2 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index cb990349eb..865328cc98 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -1337,9 +1337,9 @@ Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
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();
diff --git a/test/Sema/objc-super-test.m b/test/Sema/objc-super-test.m
new file mode 100644
index 0000000000..7575dfd840
--- /dev/null
+++ b/test/Sema/objc-super-test.m
@@ -0,0 +1,17 @@
+// RUN: clang -rewrite-test %s | clang
+
+#include <objc/objc.h>
+
+@interface SUPER
+- (int) MainMethod;
+@end
+
+@interface MyDerived : SUPER
+- (int) instanceMethod;
+@end
+
+@implementation MyDerived
+- (int) instanceMethod {
+ return [super MainMethod];
+}
+@end