From a2c3646c35dd09d21b74826240aa916545b1873f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 26 Apr 2013 16:15:35 +0000 Subject: Implement C++1y decltype(auto). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ASTContext.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/AST/ASTContext.cpp') 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; } -- cgit v1.2.3-18-g5258