diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-27 20:36:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-27 20:36:09 +0000 |
commit | 1c63b9c15d48cb8c833a4b2d6fd6c496c0766e88 (patch) | |
tree | 9eaf849fec5ba6da983d926c50678ab29e7af97b /lib | |
parent | 254e2d9e61dd0adb9c5e219d901f9872fd951728 (diff) |
When explicitly building a temporary object (CXXTemporaryObjectExpr),
keep track of whether we need to zero-initialize storage prior to
calling its constructor. Previously, we were only tracking this when
implicitly constructing the object (a CXXConstructExpr).
Fixes Boost's value-initialization tests, which means that the
Boost.Config library now passes all of its tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ExprCXX.cpp | 5 | ||||
-rw-r--r-- | lib/Sema/SemaInit.cpp | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index c394e476f8..592d887d31 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -459,9 +459,10 @@ CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, SourceLocation tyBeginLoc, Expr **Args, unsigned NumArgs, - SourceLocation rParenLoc) + SourceLocation rParenLoc, + bool ZeroInitialization) : CXXConstructExpr(C, CXXTemporaryObjectExprClass, writtenTy, tyBeginLoc, - Cons, false, Args, NumArgs), + Cons, false, Args, NumArgs, ZeroInitialization), TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) { } diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 1caa94bf81..4678822413 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -3745,7 +3745,8 @@ InitializationSequence::Perform(Sema &S, Kind.getLocation(), Exprs, NumExprs, - Kind.getParenRange().getEnd())); + Kind.getParenRange().getEnd(), + ConstructorInitRequiresZeroInit)); } else CurInit = S.BuildCXXConstructExpr(Loc, Entity.getType(), Constructor, |