diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-10-27 19:41:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-10-27 19:41:14 +0000 |
commit | 49badde06e066d058d6c7fcf4e628a72999b65a9 (patch) | |
tree | 1a5c80de6e6c3914ac1ed4f35d7211f82966bd09 /lib/Sema/SemaDecl.cpp | |
parent | a48396e10f75966ed5ca974dcc73907ce8c80dee (diff) |
Refactor the expression class hierarchy for casts. Most importantly:
- CastExpr is the root of all casts
- ImplicitCastExpr is (still) used for all explicit casts
- ExplicitCastExpr is now the root of all *explicit* casts
- ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
- CXXFunctionalCastExpr inherits from ExplicitCastExpr
- CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
- Added classes CXXStaticCastExpr, CXXDynamicCastExpr,
CXXReinterpretCastExpr, and CXXConstCastExpr to
Also, fixed returned-stack-addr.cpp, which broke once when we fixed
reinterpret_cast to diagnose double->int* conversions and again when
we eliminated implicit conversions to reference types. The fix is in
both testcase and SemaChecking.cpp.
Most of this patch is simply support for the renaming. There's very
little actual change in semantics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 624c576103..7b88ec2c16 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1060,7 +1060,7 @@ bool Sema::CheckAddressConstantExpression(const Expr* Init) { CheckArithmeticConstantExpression(IExp); } case Expr::ImplicitCastExprClass: - case Expr::ExplicitCastExprClass: { + case Expr::ExplicitCCastExprClass: { const Expr* SubExpr = cast<CastExpr>(Init)->getSubExpr(); if (Init->getStmtClass() == Expr::ImplicitCastExprClass) { // Check for implicit promotion @@ -1190,7 +1190,7 @@ static const Expr* FindExpressionBaseAddress(const Expr* E) { // if we don't, we'll figure it out later return 0; } - case Expr::ExplicitCastExprClass: { + case Expr::ExplicitCCastExprClass: { const Expr* SubExpr = cast<CastExpr>(E)->getSubExpr(); // Check for pointer->pointer cast @@ -1310,7 +1310,7 @@ bool Sema::CheckArithmeticConstantExpression(const Expr* Init) { return true; } case Expr::ImplicitCastExprClass: - case Expr::ExplicitCastExprClass: { + case Expr::ExplicitCCastExprClass: { const Expr *SubExpr = cast<CastExpr>(Init)->getSubExpr(); if (SubExpr->getType()->isArithmeticType()) return CheckArithmeticConstantExpression(SubExpr); |