summaryrefslogtreecommitdiffstats
path: root/clang/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
commitce934146d0653618922f55a37471fcbf7bd3daa1 (patch)
tree74398afd7290f8dc1a70b206284eef8938d44731 /clang/lib/Sema/SemaExprCXX.cpp
parentd20a03f30827fdb3ae4fb48522bb6b92fd31c846 (diff)
downloadbcm5719-llvm-ce934146d0653618922f55a37471fcbf7bd3daa1.tar.gz
bcm5719-llvm-ce934146d0653618922f55a37471fcbf7bd3daa1.zip
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. llvm-svn: 72176
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 30a7598ec62..b9575101b0a 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/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));
}
OpenPOWER on IntegriCloud