Bind references to opaque r-values correctly. Add a few test cases
for ?: on record types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126113 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 1b7e7a0..5d69aad 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -260,6 +260,10 @@
}
}
+ if (const OpaqueValueExpr *opaque = dyn_cast<OpaqueValueExpr>(E))
+ if (opaque->getType()->isRecordType())
+ return CGF.EmitOpaqueValueLValue(opaque).getAddress();
+
// Nothing changed.
break;
}