diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-06 19:12:38 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-06 19:12:38 +0000 |
commit | 1cf9ff87ee235ad252332a96699abdb32bd6facb (patch) | |
tree | 370e9e0a0f71cbec27755371e579451693e2ffdb /lib/Sema/SemaInit.cpp | |
parent | 70101ce87ff1d73ac90e4d99a3af0ae509e5934f (diff) |
Set and use Elidable in elimination of copy ctors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 445cd691d6..29113822f7 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -176,9 +176,10 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType, DirectInit? IK_Direct : IK_Copy); if (!Constructor) return true; - + bool Elidable = (isa<CallExpr>(Init) || + isa<CXXTemporaryObjectExpr>(Init)); Init = BuildCXXConstructExpr(Context, - DeclType, Constructor, false, &Init, 1); + DeclType, Constructor, Elidable, &Init, 1); Init = MaybeCreateCXXExprWithTemporaries(Init, /*DestroyTemps=*/true); return false; } |