[llvm-commits] [llvm-gcc-4.2] r100330 - in /llvm-gcc-4.2/trunk/gcc: objc/ChangeLog.apple objc/objc-act.c testsuite/obj-c++.dg/property-getter-codegen.mm
Evan Cheng
evan.cheng at apple.com
Sun Apr 4 10:57:26 PDT 2010
Author: evancheng
Date: Sun Apr 4 12:57:25 2010
New Revision: 100330
URL: http://llvm.org/viewvc/llvm-project?rev=100330&view=rev
Log:
Merge patch from gcc-4.2: disallowing dot-syntax on a RHS which is a c++ object that requires construction. Patch by Fariborz Jahanian.
Modified:
llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm
Modified: llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple?rev=100330&r1=100329&r2=100330&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple Sun Apr 4 12:57:25 2010
@@ -1,3 +1,10 @@
+2010-04-02 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 7591784
+ * objc-act.c (objc_build_compound_setter_call): Issue unimplemented
+ error attempting to use dot-syntax on a RHS which is c++ object
+ requiring construction.
+
2019-03-17 Jim Grosbach <grosbach at apple.com>
Radar 6671703
Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=100330&r1=100329&r2=100330&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Sun Apr 4 12:57:25 2010
@@ -1983,7 +1983,22 @@
bind = build3 (BIND_EXPR, void_type_node, temp, NULL, NULL);
TREE_SIDE_EFFECTS (bind) = 1;
add_stmt (bind);
+ /* APPLE LOCAL begin radar 7591784 */
+#ifdef OBJCPLUS
+ {
+ tree type = TREE_TYPE (rhs);
+ if (TYPE_NEEDS_CONSTRUCTING (type))
+ {
+ comma_exp = temp;
+ error("setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary.");
+ }
+ else
+ comma_exp = build_modify_expr (temp, NOP_EXPR, rhs);
+ }
+#else
comma_exp = build_modify_expr (temp, NOP_EXPR, rhs);
+#endif
+ /* APPLE LOCAL end radar 7591784 */
comma_exp = build_compound_expr (comma_exp,
objc_setter_func_call (receiver, prop_ident, temp));
/* APPLE LOCAL begin radar 6264448 */
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-getter-codegen.mm?rev=100330&r1=100329&r2=100330&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm Sun Apr 4 12:57:25 2010
@@ -98,7 +98,11 @@
// Each of these looks like it should call the setPosition method. However,
// if the Vector3D copy constructor is defined, this one won't.
- myObject.position = Vector3D(1.0f, 1.0f, 1.0f);
+ // APPLE LOCAL begin radar 7591784
+ // Workaround for bug in radar 7591784
+ Vector3D V3D(1.0f, 1.0f, 1.0f);
+ myObject.position = V3D;
+ // APPLE LOCAL end radar 7591784
NSLog(@"After assignment the position is: %@", myObject.position.description());
[myObject setPosition: Vector3D(2.0f, 2.0f, 2.0f)];
More information about the llvm-commits
mailing list