c++ object into block descriptor. // rdar://
9971124
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143475
91177308-0d34-0410-b5e6-
96231b3b80d8
// Okay, we descended all the way to the block that defines the variable.
// Actually try to capture it.
QualType type = var->getType();
-
+
+ if (type->isRValueReferenceType())
+ type = type->getPointeeType();
+
// Prohibit variably-modified types.
if (type->isVariablyModifiedType()) {
S.Diag(loc, diag::err_ref_vm_type);
// CHECK: [[C:%.*]] = getelementptr inbounds <{ {{.*}} i32 }>* [[B]]
// CHECK: [[R:%.*]] = load i32* [[C]], align 4
// CHECK: ret i32 [[R]]
+
+class S {
+public:
+ S (const S &);
+ S(int);
+ int field;
+};
+
+int func(S && rv)
+{
+ return ^{ return rv.field; }();
+}
+
+// CHECK: define i32 @_Z4funcO1S
+// CHECK: call void @_ZN1SC1ERKS_