summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-15 06:24:57 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-15 06:24:57 +0000
commitbd1530949d568ad5da39b9d33adef8a5d0552961 (patch)
tree7171f3bb8f339b705a43e882f4df9759226f7f4a /clang/lib
parent2ec4061e39908f73bdb7d75da9f4374d001809eb (diff)
downloadbcm5719-llvm-bd1530949d568ad5da39b9d33adef8a5d0552961.tar.gz
bcm5719-llvm-bd1530949d568ad5da39b9d33adef8a5d0552961.zip
decltype(e) is type-dependent if e is instantiation-dependent. Scary but true.
Don't consider decltype(e) for an instantiation-dependent, but not type-dependent, e to be non-type-dependent but canonical(!). llvm-svn: 148210
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Type.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 99468b8f613..7fd83b54e40 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -1739,7 +1739,10 @@ void DependentTypeOfExprType::Profile(llvm::FoldingSetNodeID &ID,
}
DecltypeType::DecltypeType(Expr *E, QualType underlyingType, QualType can)
- : Type(Decltype, can, E->isTypeDependent(),
+ // C++11 [temp.type]p2: "If an expression e involves a template parameter,
+ // decltype(e) denotes a unique dependent type." Hence a decltype type is
+ // type-dependent even if its expression is only instantiation-dependent.
+ : Type(Decltype, can, E->isInstantiationDependent(),
E->isInstantiationDependent(),
E->getType()->isVariablyModifiedType(),
E->containsUnexpandedParameterPack()),
OpenPOWER on IntegriCloud