aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-11-10 23:32:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-11-10 23:32:36 +0000
commitacdfa4d504a8f2514d60569f9ce55d45f11795b9 (patch)
treecea6544b8493449e42fdb664cb3814cfb8a279e3 /lib/Sema/Sema.cpp
parentce117a7d289f57f792e5cc3294280cfe070433de (diff)
Implicit casts from rvalue to lvalue are not meaningful. Don't accidentally add
them when performing a const conversion on the implicit object argument for a member operator call on an rvalue. No change to the testsuite: the test for this change is that the added assertion does not fire any more. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index d36b67aed8..b8dec3cb6b 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -252,6 +252,7 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
break;
}
}
+ assert((VK == VK_RValue || !E->isRValue()) && "can't cast rvalue to lvalue");
#endif
QualType ExprTy = Context.getCanonicalType(E->getType());