summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-06-25 15:00:34 +0000
committerAnders Carlsson <andersca@mac.com>2009-06-25 15:00:34 +0000
commit7d209570b69bc5fe99c80b92e18579489c6bc377 (patch)
tree7c8919f153b8aa0d9d8706fe93910a716ea99def /clang/lib/AST/ASTContext.cpp
parent1a20d2ab98c123aa000592f96aacaf3daf4b58d7 (diff)
downloadbcm5719-llvm-7d209570b69bc5fe99c80b92e18579489c6bc377.tar.gz
bcm5719-llvm-7d209570b69bc5fe99c80b92e18579489c6bc377.zip
Decltype needs to have a dependent type if the expr passed to it is type dependent. Fixes PR4444.
llvm-svn: 74175
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 377d2fbe9a3..16a62fdd8cd 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -1666,6 +1666,9 @@ QualType ASTContext::getTypeOfType(QualType tofType) {
/// getDecltypeForExpr - Given an expr, will return the decltype for that
/// expression, according to the rules in C++0x [dcl.type.simple]p4
static QualType getDecltypeForExpr(const Expr *e, ASTContext &Context) {
+ if (e->isTypeDependent())
+ return Context.DependentTy;
+
// If e is an id expression or a class member access, decltype(e) is defined
// as the type of the entity named by e.
if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(e)) {
OpenPOWER on IntegriCloud