diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-15 06:24:57 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-15 06:24:57 +0000 |
commit | fa16125aaf667c2bd80efcea403a7a71aa65da14 (patch) | |
tree | 34bd0c590d28b7748ffe84b5673061c76182a56c /lib/AST/Type.cpp | |
parent | 244ee7b89a483fd3764637abdf95de2893b437d0 (diff) |
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(!).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 99468b8f61..7fd83b54e4 100644 --- a/lib/AST/Type.cpp +++ b/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()), |