aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-20 18:46:25 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-20 18:46:25 +0000
commitd81e6ca6e378c3996a139066a5c4b7fc1869630c (patch)
tree4353b92ebccd58fdc512092bcfe7c3199131c1a3 /lib/Sema/SemaExprCXX.cpp
parent9cd96ff7dfcb51fdba03df8803fff6cc36e9633f (diff)
Introduce a new expression type, CXXUnresolvedConstructExpr, to
describe the construction of a value of a given type using function syntax, e.g., T(a1, a2, ..., aN) when the type or any of its arguments are type-dependent. In this case, we don't know what kind of type-construction this will be: it might construct a temporary of type 'T' (which might be a class or non-class type) or might perform a conversion to type 'T'. Also, implement printing of and template instantiation for this new expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr, our existing tests cover template instantiation of this new expression node. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 30a7598ec6..b9575101b0 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -164,14 +164,11 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
CallExpr::hasAnyTypeDependentArguments(Exprs, NumExprs)) {
exprs.release();
- // FIXME: Is this correct (I don't think so). Instead, we should have an
- // CXXUnresolvedTemporaryObjectExpr node for this.
- CXXTempVarDecl *Temp = CXXTempVarDecl::Create(Context, CurContext, Ty);
-
- return Owned(new (Context) CXXTemporaryObjectExpr(Context, Temp, 0, Ty,
- TyBeginLoc,
- Exprs, NumExprs,
- RParenLoc));
+ return Owned(CXXUnresolvedConstructExpr::Create(Context,
+ TypeRange.getBegin(), Ty,
+ LParenLoc,
+ Exprs, NumExprs,
+ RParenLoc));
}