aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-26 16:15:35 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-26 16:15:35 +0000
commita2c3646c35dd09d21b74826240aa916545b1873f (patch)
treee2a57dcc3d41734ea9734c76a9d759c8951392f4 /lib/AST/ASTContext.cpp
parentbebf5b1bcfbf591dd3cd80c4aebd6486bb34f41c (diff)
Implement C++1y decltype(auto).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index f9622455c0..22ee0cfcb6 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -3516,17 +3516,19 @@ QualType ASTContext::getUnaryTransformType(QualType BaseType,
}
/// getAutoType - We only unique auto types after they've been deduced.
-QualType ASTContext::getAutoType(QualType DeducedType) const {
+QualType ASTContext::getAutoType(QualType DeducedType,
+ bool IsDecltypeAuto) const {
void *InsertPos = 0;
if (!DeducedType.isNull()) {
// Look in the folding set for an existing type.
llvm::FoldingSetNodeID ID;
- AutoType::Profile(ID, DeducedType);
+ AutoType::Profile(ID, DeducedType, IsDecltypeAuto);
if (AutoType *AT = AutoTypes.FindNodeOrInsertPos(ID, InsertPos))
return QualType(AT, 0);
}
- AutoType *AT = new (*this, TypeAlignment) AutoType(DeducedType);
+ AutoType *AT = new (*this, TypeAlignment) AutoType(DeducedType,
+ IsDecltypeAuto);
Types.push_back(AT);
if (InsertPos)
AutoTypes.InsertNode(AT, InsertPos);
@@ -3564,7 +3566,7 @@ QualType ASTContext::getAtomicType(QualType T) const {
/// getAutoDeductType - Get type pattern for deducing against 'auto'.
QualType ASTContext::getAutoDeductType() const {
if (AutoDeductTy.isNull())
- AutoDeductTy = getAutoType(QualType());
+ AutoDeductTy = getAutoType(QualType(), false);
assert(!AutoDeductTy.isNull() && "can't build 'auto' pattern");
return AutoDeductTy;
}