Spell isPRValue() properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 94fb086..db4d231 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1753,8 +1753,7 @@
return EmitUnsupportedLValue(E, "unexpected cast lvalue");
case CastExpr::CK_NoOp:
- if (E->getSubExpr()->getType()->isRecordType() ||
- E->getSubExpr()->isLvalue(getContext()) == Expr::LV_Valid) {
+ if (!E->getSubExpr()->Classify(getContext()).isPRValue()) {
LValue LV = EmitLValue(E->getSubExpr());
if (LV.isPropertyRef()) {
QualType QT = E->getSubExpr()->getType();