diff options
author | Anders Carlsson <andersca@mac.com> | 2009-05-19 04:45:15 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-05-19 04:45:15 +0000 |
commit | 7c3e8a1ddb19030a7937e02afd59607c40026348 (patch) | |
tree | 8816d837fa8b260eb73a0c93a2a49a1ab5011bf5 | |
parent | ac8d6298a8ae9276412d8c054957dfa65a69eb14 (diff) |
Create CXXConstructExpr calls for arguments passed to functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72102 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 109247f977..30a7598ec6 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -854,9 +854,13 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType, QualType FromType = From->getType(); if (SCS.CopyConstructor) { - // FIXME: Create a temporary object by calling the copy constructor. - ImpCastExprToType(From, ToType.getNonReferenceType(), - ToType->isLValueReferenceType()); + // FIXME: When can ToType be a reference type? + assert(!ToType->isReferenceType()); + + CXXTempVarDecl *Temp = CXXTempVarDecl::Create(Context, CurContext, ToType); + // FIXME: Keep track of whether the copy constructor is elidable or not. + From = CXXConstructExpr::Create(Context, Temp, ToType, + SCS.CopyConstructor, false, &From, 1); return false; } |