diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-16 00:30:48 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-16 00:30:48 +0000 |
commit | 76e4ce42a30cee4dc40ce7c6014874fbc4f9baa7 (patch) | |
tree | ee6740164b52b0c1683e7cd20f73746c5098d384 /lib/AST/ASTContext.cpp | |
parent | cb83c530ee82c0107720129473fa78336b6f4879 (diff) |
Keep track of whether a type parameter type is a parameter pack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 7ed9e45fce..d97d2155c0 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1414,11 +1414,13 @@ QualType ASTContext::getObjCInterfaceType(const ObjCInterfaceDecl *Decl) { } /// \brief Retrieve the template type parameter type for a template -/// parameter with the given depth, index, and (optionally) name. +/// parameter or parameter pack with the given depth, index, and (optionally) +/// name. QualType ASTContext::getTemplateTypeParmType(unsigned Depth, unsigned Index, + bool ParameterPack, IdentifierInfo *Name) { llvm::FoldingSetNodeID ID; - TemplateTypeParmType::Profile(ID, Depth, Index, Name); + TemplateTypeParmType::Profile(ID, Depth, Index, ParameterPack, Name); void *InsertPos = 0; TemplateTypeParmType *TypeParm = TemplateTypeParmTypes.FindNodeOrInsertPos(ID, InsertPos); @@ -1426,11 +1428,12 @@ QualType ASTContext::getTemplateTypeParmType(unsigned Depth, unsigned Index, if (TypeParm) return QualType(TypeParm, 0); - if (Name) - TypeParm = new (*this, 8) TemplateTypeParmType(Depth, Index, Name, - getTemplateTypeParmType(Depth, Index)); - else - TypeParm = new (*this, 8) TemplateTypeParmType(Depth, Index); + if (Name) { + QualType Canon = getTemplateTypeParmType(Depth, Index, ParameterPack); + TypeParm = new (*this, 8) TemplateTypeParmType(Depth, Index, ParameterPack, + Name, Canon); + } else + TypeParm = new (*this, 8) TemplateTypeParmType(Depth, Index, ParameterPack); Types.push_back(TypeParm); TemplateTypeParmTypes.InsertNode(TypeParm, InsertPos); |