diff options
author | John McCall <rjmccall@apple.com> | 2011-10-05 07:41:44 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-10-05 07:41:44 +0000 |
commit | b50451a188b8b360e9a361d31e9c823cc31515c7 (patch) | |
tree | 04950c5be6eae6130a5564e3ac14daa76105f3f7 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | ad33c139accb4b1af2b60d76e33507808ee227cb (diff) | |
download | bcm5719-llvm-b50451a188b8b360e9a361d31e9c823cc31515c7.tar.gz bcm5719-llvm-b50451a188b8b360e9a361d31e9c823cc31515c7.zip |
Refactor the analysis of C++ cast expressions so that even
C-style and functional casts are built in SemaCXXCast.cpp.
Introduce a helper class to encapsulate most of the random
state being passed around, at least one level down.
llvm-svn: 141170
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 946f02c567d..7571f7610c9 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -739,27 +739,10 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo, // If the expression list is a single expression, the type conversion // expression is equivalent (in definedness, and if defined in meaning) to the // corresponding cast expression. - // if (NumExprs == 1) { - CastKind Kind = CK_Invalid; - ExprValueKind VK = VK_RValue; - CXXCastPath BasePath; - ExprResult CastExpr = - CheckCastTypes(TInfo->getTypeLoc().getBeginLoc(), - TInfo->getTypeLoc().getSourceRange(), Ty, Exprs[0], - Kind, VK, BasePath, - /*FunctionalStyle=*/true); - if (CastExpr.isInvalid()) - return ExprError(); - Exprs[0] = CastExpr.take(); - + Expr *Arg = Exprs[0]; exprs.release(); - - return Owned(CXXFunctionalCastExpr::Create(Context, - Ty.getNonLValueExprType(Context), - VK, TInfo, TyBeginLoc, Kind, - Exprs[0], &BasePath, - RParenLoc)); + return BuildCXXFunctionalCastExpr(TInfo, LParenLoc, Arg, RParenLoc); } InitializedEntity Entity = InitializedEntity::InitializeTemporary(TInfo); |