[cfe-commits] r72102 - /cfe/trunk/lib/Sema/SemaExprCXX.cpp
Anders Carlsson
andersca at mac.com
Mon May 18 21:45:15 PDT 2009
Author: andersca
Date: Mon May 18 23:45:15 2009
New Revision: 72102
URL: http://llvm.org/viewvc/llvm-project?rev=72102&view=rev
Log:
Create CXXConstructExpr calls for arguments passed to functions.
Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=72102&r1=72101&r2=72102&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Mon May 18 23:45:15 2009
@@ -854,9 +854,13 @@
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;
}
More information about the cfe-commits
mailing list