aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.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
commit1cf9ff87ee235ad252332a96699abdb32bd6facb (patch)
tree370e9e0a0f71cbec27755371e579451693e2ffdb /lib/Sema/SemaExprCXX.cpp
parent70101ce87ff1d73ac90e4d99a3af0ae509e5934f (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/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 7e0422e432..5b74938191 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -911,8 +911,10 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
assert(!ToType->isReferenceType());
// FIXME: Keep track of whether the copy constructor is elidable or not.
- From = BuildCXXConstructExpr(Context,
- ToType, SCS.CopyConstructor, false, &From, 1);
+ bool Elidable = (isa<CallExpr>(From) ||
+ isa<CXXTemporaryObjectExpr>(From));
+ From = BuildCXXConstructExpr(Context, ToType,
+ SCS.CopyConstructor, Elidable, &From, 1);
return false;
}