diff options
author | John McCall <rjmccall@apple.com> | 2010-11-24 05:12:34 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-24 05:12:34 +0000 |
commit | 086a464e24de0d01fc9fa51cff73f3bbc4ac0ba3 (patch) | |
tree | 7c3525b9486d35300037036b925cb2276b2c5848 /clang/lib/Sema/SemaCXXCast.cpp | |
parent | e2ea8bf9454d5a2d4d0b8bcdd06662519ec7d5a0 (diff) | |
download | bcm5719-llvm-086a464e24de0d01fc9fa51cff73f3bbc4ac0ba3.tar.gz bcm5719-llvm-086a464e24de0d01fc9fa51cff73f3bbc4ac0ba3.zip |
Switch a lot of call-sites over to using the new value-kind calculations.
llvm-svn: 120084
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 06c2758a9bd..5997d98fa58 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -375,7 +375,7 @@ CheckDynamicCast(Sema &Self, Expr *&SrcExpr, QualType DestType, return; } } else if (DestReference->isLValueReferenceType()) { - if (SrcExpr->isLvalue(Self.Context) != Expr::LV_Valid) { + if (!SrcExpr->isLValue()) { Self.Diag(OpRange.getBegin(), diag::err_bad_cxx_cast_rvalue) << CT_Dynamic << OrigSrcType << OrigDestType << OpRange; } @@ -698,7 +698,7 @@ TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, QualType DestType, if (!R) return TC_NotApplicable; - if (SrcExpr->isLvalue(Self.Context) != Expr::LV_Valid) + if (!SrcExpr->isLValue()) return TC_NotApplicable; // Because we try the reference downcast before this function, from now on @@ -739,7 +739,7 @@ TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr, QualType DestType, return TC_NotApplicable; } bool RValueRef = DestReference->isRValueReferenceType(); - if (!RValueRef && SrcExpr->isLvalue(Self.Context) != Expr::LV_Valid) { + if (!RValueRef && !SrcExpr->isLValue()) { // We know the left side is an lvalue reference, so we can suggest a reason. msg = diag::err_bad_cxx_cast_rvalue; return TC_NotApplicable; @@ -1049,7 +1049,7 @@ static TryCastResult TryConstCast(Sema &Self, Expr *SrcExpr, QualType DestType, QualType SrcType = SrcExpr->getType(); if (const LValueReferenceType *DestTypeTmp = DestType->getAs<LValueReferenceType>()) { - if (SrcExpr->isLvalue(Self.Context) != Expr::LV_Valid) { + if (!SrcExpr->isLValue()) { // Cannot const_cast non-lvalue to lvalue reference type. But if this // is C-style, static_cast might find a way, so we simply suggest a // message and tell the parent to keep searching. @@ -1152,7 +1152,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, Expr *SrcExpr, if (const ReferenceType *DestTypeTmp = DestType->getAs<ReferenceType>()) { bool LValue = DestTypeTmp->isLValueReferenceType(); - if (LValue && SrcExpr->isLvalue(Self.Context) != Expr::LV_Valid) { + if (LValue && !SrcExpr->isLValue()) { // Cannot cast non-lvalue to reference type. See the similar comment in // const_cast. msg = diag::err_bad_cxx_cast_rvalue; |