summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-13 21:01:28 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-13 21:01:28 +0000
commit0950e41b73587a71ee66c88cf8db0dfff343a8cf (patch)
treea7d6054a981badf7424c934d5e12969bb3da8070 /clang/lib/Sema/SemaExprCXX.cpp
parent5b86bf527ea41117edac3728e6d803d8723de888 (diff)
downloadbcm5719-llvm-0950e41b73587a71ee66c88cf8db0dfff343a8cf.tar.gz
bcm5719-llvm-0950e41b73587a71ee66c88cf8db0dfff343a8cf.zip
Implement template instantiation for several more kinds of expressions:
- C++ function casts, e.g., T(foo) - sizeof(), alignof() More importantly, this allows us to verify that we're performing overload resolution during template instantiation, with argument-dependent lookup and the "cached" results of name lookup from the template definition. llvm-svn: 66947
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 501eda74438..e5a252043ed 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -122,6 +122,13 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
SourceLocation TyBeginLoc = TypeRange.getBegin();
SourceRange FullRange = SourceRange(TyBeginLoc, RParenLoc);
+ if (Ty->isDependentType() ||
+ CallExpr::hasAnyTypeDependentArguments(Exprs, NumExprs)) {
+ return new (Context) CXXTemporaryObjectExpr(0, Ty, TyBeginLoc,
+ Exprs, NumExprs, RParenLoc);
+ }
+
+
// C++ [expr.type.conv]p1:
// If the expression list is a single expression, the type conversion
// expression is equivalent (in definedness, and if defined in meaning) to the
@@ -134,8 +141,6 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
TyBeginLoc, Exprs[0], RParenLoc);
}
- // FIXME: What AST node to create when the type is dependent?
-
if (const RecordType *RT = Ty->getAsRecordType()) {
CXXRecordDecl *Record = cast<CXXRecordDecl>(RT->getDecl());
OpenPOWER on IntegriCloud