]> granicus.if.org Git - clang/commitdiff
Changed type-cast of "struct objc_super"'s 2nd initializer to match definition of
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 5 Dec 2007 17:29:46 +0000 (17:29 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 5 Dec 2007 17:29:46 +0000 (17:29 +0000)
"struct objc_super".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44616 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp
test/Sema/objc-super-test.m [new file with mode: 0644]

index cb990349ebfa88397c370f24e7c74f452dd21493..865328cc986edd852f7132f4ecd007b73d1a764b 100644 (file)
@@ -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 (file)
index 0000000..7575dfd
--- /dev/null
@@ -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