summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-10-16 02:35:04 +0000
committerAnders Carlsson <andersca@mac.com>2009-10-16 02:35:04 +0000
commitef918ac840036fdf2f085d2acc7270c16585b136 (patch)
tree945e8bf458a0861d30dc19d0c803caab4cdad2e3 /clang/lib/Sema/SemaExpr.cpp
parentcb4e68c34032d5de2983e3ae6bebfbb25875dd23 (diff)
downloadbcm5719-llvm-ef918ac840036fdf2f085d2acc7270c16585b136.tar.gz
bcm5719-llvm-ef918ac840036fdf2f085d2acc7270c16585b136.zip
Add a ToVoid cast kind and start using it.
llvm-svn: 84241
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d818a5027e6..279f50b9a71 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -3157,7 +3157,11 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr,
// type needs to be scalar.
if (castType->isVoidType()) {
// Cast to void allows any expr type.
- } else if (!castType->isScalarType() && !castType->isVectorType()) {
+ Kind = CastExpr::CK_ToVoid;
+ return false;
+ }
+
+ if (!castType->isScalarType() && !castType->isVectorType()) {
if (Context.getCanonicalType(castType).getUnqualifiedType() ==
Context.getCanonicalType(castExpr->getType().getUnqualifiedType()) &&
(castType->isStructureType() || castType->isUnionType())) {
OpenPOWER on IntegriCloud