diff options
Diffstat (limited to 'lib/Sema/SemaNamedCast.cpp')
-rw-r--r-- | lib/Sema/SemaNamedCast.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Sema/SemaNamedCast.cpp b/lib/Sema/SemaNamedCast.cpp index e2137b3001..c5bee98a37 100644 --- a/lib/Sema/SemaNamedCast.cpp +++ b/lib/Sema/SemaNamedCast.cpp @@ -76,26 +76,26 @@ Sema::ActOnCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, case tok::kw_const_cast: if (!TypeDependent) CheckConstCast(*this, Ex, DestType, OpRange, DestRange); - return new CXXConstCastExpr(DestType.getNonReferenceType(), Ex, - DestType, OpLoc); + return new (Context) CXXConstCastExpr(DestType.getNonReferenceType(), Ex, + DestType, OpLoc); case tok::kw_dynamic_cast: if (!TypeDependent) CheckDynamicCast(*this, Ex, DestType, OpRange, DestRange); - return new CXXDynamicCastExpr(DestType.getNonReferenceType(), Ex, - DestType, OpLoc); + return new (Context)CXXDynamicCastExpr(DestType.getNonReferenceType(), Ex, + DestType, OpLoc); case tok::kw_reinterpret_cast: if (!TypeDependent) CheckReinterpretCast(*this, Ex, DestType, OpRange, DestRange); - return new CXXReinterpretCastExpr(DestType.getNonReferenceType(), Ex, - DestType, OpLoc); + return new (Context) CXXReinterpretCastExpr(DestType.getNonReferenceType(), + Ex, DestType, OpLoc); case tok::kw_static_cast: if (!TypeDependent) CheckStaticCast(*this, Ex, DestType, OpRange); - return new CXXStaticCastExpr(DestType.getNonReferenceType(), Ex, - DestType, OpLoc); + return new (Context) CXXStaticCastExpr(DestType.getNonReferenceType(), Ex, + DestType, OpLoc); } return true; |