diff options
author | John McCall <rjmccall@apple.com> | 2010-08-23 06:53:58 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-23 06:53:58 +0000 |
commit | 1f58816e6589ef15d1509c6c99bb8fabf2a4cda9 (patch) | |
tree | c1711ff22597aa1d0ae08aa2ffb9369c89014377 | |
parent | ca0408fb49c1370430672acf2d770b7151cf71de (diff) |
Kill off Parser::TemplateParameterList to avoid misparses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111796 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Parse/Parser.h | 5 | ||||
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 87e0b42a37..f1e4f956ce 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1469,7 +1469,6 @@ private: //===--------------------------------------------------------------------===// // C++ 14: Templates [temp] - typedef llvm::SmallVector<Decl *, 4> TemplateParameterList; // C++ 14.1: Template Parameters [temp.param] Decl *ParseDeclarationStartingWithTemplate(unsigned Context, @@ -1485,11 +1484,11 @@ private: SourceLocation &DeclEnd, AccessSpecifier AS=AS_none); bool ParseTemplateParameters(unsigned Depth, - TemplateParameterList &TemplateParams, + llvm::SmallVectorImpl<Decl*> &TemplateParams, SourceLocation &LAngleLoc, SourceLocation &RAngleLoc); bool ParseTemplateParameterList(unsigned Depth, - TemplateParameterList &TemplateParams); + llvm::SmallVectorImpl<Decl*> &TemplateParams); bool isStartOfTemplateTypeParameter(); Decl *ParseTemplateParameter(unsigned Depth, unsigned Position); Decl *ParseTypeParameter(unsigned Depth, unsigned Position); diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index dec41d9292..5d5fc9ce3b 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -127,7 +127,7 @@ Parser::ParseTemplateDeclarationOrSpecialization(unsigned Context, // Parse the '<' template-parameter-list '>' SourceLocation LAngleLoc, RAngleLoc; - TemplateParameterList TemplateParams; + llvm::SmallVector<Decl*, 4> TemplateParams; if (ParseTemplateParameters(Depth, TemplateParams, LAngleLoc, RAngleLoc)) { // Skip until the semi-colon or a }. @@ -281,7 +281,7 @@ Parser::ParseSingleDeclarationAfterTemplate( /// /// \returns true if an error occurred, false otherwise. bool Parser::ParseTemplateParameters(unsigned Depth, - TemplateParameterList &TemplateParams, + llvm::SmallVectorImpl<Decl*> &TemplateParams, SourceLocation &LAngleLoc, SourceLocation &RAngleLoc) { // Get the template parameter list. @@ -314,7 +314,7 @@ bool Parser::ParseTemplateParameters(unsigned Depth, /// template-parameter-list ',' template-parameter bool Parser::ParseTemplateParameterList(unsigned Depth, - TemplateParameterList &TemplateParams) { + llvm::SmallVectorImpl<Decl*> &TemplateParams) { while (1) { if (Decl *TmpParam = ParseTemplateParameter(Depth, TemplateParams.size())) { @@ -504,7 +504,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) { // Handle the template <...> part. SourceLocation TemplateLoc = ConsumeToken(); - TemplateParameterList TemplateParams; + llvm::SmallVector<Decl*,8> TemplateParams; SourceLocation LAngleLoc, RAngleLoc; { ParseScope TemplateParmScope(this, Scope::TemplateParamScope); |