summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCXXCast.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-30 02:05:44 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-30 02:05:44 +0000
commit4cec5f806bcf10a9247c16cddbbb8966ccd3de33 (patch)
treebf0fd31046b1e8d8ef2e320c31321f006c78d35d /clang/lib/Sema/SemaCXXCast.cpp
parent6c7f64e0bcae3f8f5bfb9348337d579614e0739a (diff)
downloadbcm5719-llvm-4cec5f806bcf10a9247c16cddbbb8966ccd3de33.tar.gz
bcm5719-llvm-4cec5f806bcf10a9247c16cddbbb8966ccd3de33.zip
Fix another case of giving the wrong value kind to a dependent cast to
a non-dependent type. llvm-svn: 120384
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r--clang/lib/Sema/SemaCXXCast.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp
index 2a52f178765..214d1f61755 100644
--- a/clang/lib/Sema/SemaCXXCast.cpp
+++ b/clang/lib/Sema/SemaCXXCast.cpp
@@ -1375,13 +1375,16 @@ Sema::CXXCheckCStyleCast(SourceRange R, QualType CastTy, ExprValueKind &VK,
return false;
}
+ // Make sure we determine the value kind before we bail out for
+ // dependent types.
+ VK = Expr::getValueKindForType(CastTy);
+
// If the type is dependent, we won't do any other semantic analysis now.
if (CastTy->isDependentType() || CastExpr->isTypeDependent()) {
Kind = CK_Dependent;
return false;
}
- VK = Expr::getValueKindForType(CastTy);
if (VK == VK_RValue && !CastTy->isRecordType())
DefaultFunctionArrayLvalueConversion(CastExpr);
OpenPOWER on IntegriCloud