]> granicus.if.org Git - clang/commitdiff
Kill off Parser::TemplateParameterList to avoid misparses.
authorJohn McCall <rjmccall@apple.com>
Mon, 23 Aug 2010 06:53:58 +0000 (06:53 +0000)
committerJohn McCall <rjmccall@apple.com>
Mon, 23 Aug 2010 06:53:58 +0000 (06:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111796 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Parser.h
lib/Parse/ParseTemplate.cpp

index 87e0b42a37e8e48ece49c9face7b06bcd5ecbd48..f1e4f956ce04e31eb572b4038cd0f13e7e509284 100644 (file)
@@ -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);
index dec41d9292d9e9756c6041b1aeef4f975f92a467..5d5fc9ce3bd13cc9e0d47b2e9bff7e65118b1d99 100644 (file)
@@ -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);