summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCXXCast.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-26 10:57:22 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-26 10:57:22 +0000
commit29ac8e2ecd275ec969292d003c4f3b17fdfef907 (patch)
tree647f298429b498fe0f892006edc475dbe9a97ebe /clang/lib/Sema/SemaCXXCast.cpp
parent98fa0159fcc6d8b4c7f61ab727b9e110863b35fc (diff)
downloadbcm5719-llvm-29ac8e2ecd275ec969292d003c4f3b17fdfef907.tar.gz
bcm5719-llvm-29ac8e2ecd275ec969292d003c4f3b17fdfef907.zip
For internal consistency's sake, compute the value kind of a dependent cast
based on the known properties of the casted-to type. Fixes a crash on spirit. llvm-svn: 120180
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r--clang/lib/Sema/SemaCXXCast.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp
index 5997d98fa58..2a52f178765 100644
--- a/clang/lib/Sema/SemaCXXCast.cpp
+++ b/clang/lib/Sema/SemaCXXCast.cpp
@@ -161,6 +161,9 @@ Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind,
<< Ex->getSourceRange();
ExprValueKind VK = VK_RValue;
+ if (TypeDependent)
+ VK = Expr::getValueKindForType(DestType);
+
switch (Kind) {
default: llvm_unreachable("Unknown C++ cast!");
OpenPOWER on IntegriCloud