]> granicus.if.org Git - clang/commitdiff
Return type of a setter call caused by
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 24 Jul 2010 00:34:08 +0000 (00:34 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 24 Jul 2010 00:34:08 +0000 (00:34 +0000)
use of property-dot syntax using 'super' as receiver
is 'void'. This fixes a bug in generating correct
API for setter call. Fixes radar 8203426.

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

lib/CodeGen/CGObjC.cpp
test/CodeGenObjC/super-dotsyntax-struct-property.m [new file with mode: 0644]

index be060b42e1a6a0d8c0862d7bb37a40832e23fe88..62a118cb02e2d54f05eb1f7febee711398c48cc8 100644 (file)
@@ -572,7 +572,7 @@ void CodeGenFunction::EmitObjCSuperPropertySet(const Expr *Exp,
   Args.push_back(std::make_pair(Src, Exp->getType()));
   CGM.getObjCRuntime().GenerateMessageSendSuper(*this,
                                                 ReturnValueSlot(),
-                                                Exp->getType(),
+                                                getContext().VoidTy,
                                                 S,
                                                 OMD->getClassInterface(),
                                                 isCategoryImpl,
diff --git a/test/CodeGenObjC/super-dotsyntax-struct-property.m b/test/CodeGenObjC/super-dotsyntax-struct-property.m
new file mode 100644 (file)
index 0000000..aac4c1d
--- /dev/null
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10  -fobjc-nonfragile-abi -emit-llvm %s -o -  | FileCheck %s
+// rdar: // 8203426
+
+
+typedef double CGFloat;
+struct CGPoint {
+  CGFloat x;
+  CGFloat y;
+};
+typedef struct CGPoint CGPoint;
+
+
+
+struct CGSize {
+  CGFloat width;
+  CGFloat height;
+};
+typedef struct CGSize CGSize;
+
+
+struct CGRect {
+  CGPoint origin;
+  CGSize size;
+};
+typedef struct CGRect CGRect;
+
+@interface UIView {
+}
+@property CGRect frame;
+@end
+
+@interface crashclass : UIView {
+
+}
+
+@end
+
+@implementation crashclass
+- (void)setFrame:(CGRect)frame
+{
+        super.frame = frame;
+       [super setFrame:frame];
+}
+
+@end
+// CHECK-NOT: declare void @objc_msgSendSuper2_stret
+// CHECK: declare i8* @objc_msgSendSuper2