summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-08-06 19:12:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-08-06 19:12:38 +0000
commit001309371e199f0c5f3931b80f67309dcd157848 (patch)
treeb6d4bccd47e351295b4aa93a4ceecf62af103220 /clang/lib/Sema/SemaInit.cpp
parent0127031c20ddd202b5ec43eb951965f0c489b2cb (diff)
downloadbcm5719-llvm-001309371e199f0c5f3931b80f67309dcd157848.tar.gz
bcm5719-llvm-001309371e199f0c5f3931b80f67309dcd157848.zip
Set and use Elidable in elimination of copy ctors.
llvm-svn: 78331
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 445cd691d6a..29113822f73 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud