diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-08-07 23:22:37 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-08-07 23:22:37 +0000 |
| commit | ec143777ba045bf67d57834ecd29b1d108b07a68 (patch) | |
| tree | 1f8d6e137a0fd20de4d62e45b721331ca4c8a4b9 /clang/lib/Sema/SemaExpr.cpp | |
| parent | e35472e3a948a0b2e71e18c2c7ad781216e50a43 (diff) | |
| download | bcm5719-llvm-ec143777ba045bf67d57834ecd29b1d108b07a68.tar.gz bcm5719-llvm-ec143777ba045bf67d57834ecd29b1d108b07a68.zip | |
Add CK_ToUnion and use it for aggregate expression codegen.
llvm-svn: 78429
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 684c2dafdba..6f75b59c305 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2990,6 +2990,7 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, // FIXME: Check that the cast destination type is complete. Diag(TyR.getBegin(), diag::ext_typecheck_cast_nonscalar) << castType << castExpr->getSourceRange(); + Kind = CastExpr::CK_NoOp; } else if (castType->isUnionType()) { // GCC cast to union extension RecordDecl *RD = castType->getAs<RecordType>()->getDecl(); @@ -3006,6 +3007,7 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, if (Field == FieldEnd) return Diag(TyR.getBegin(), diag::err_typecheck_cast_to_union_no_type) << castExpr->getType() << castExpr->getSourceRange(); + Kind = CastExpr::CK_ToUnion; } else { // Reject any other conversions to non-scalar types. return Diag(TyR.getBegin(), diag::err_typecheck_cond_expect_scalar) |

