[cfe-commits] r111796 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/ParseTemplate.cpp
John McCall
rjmccall at apple.com
Sun Aug 22 23:53:58 PDT 2010
Author: rjmccall
Date: Mon Aug 23 01:53:58 2010
New Revision: 111796
URL: http://llvm.org/viewvc/llvm-project?rev=111796&view=rev
Log:
Kill off Parser::TemplateParameterList to avoid misparses.
Modified:
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/lib/Parse/ParseTemplate.cpp
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=111796&r1=111795&r2=111796&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Mon Aug 23 01:53:58 2010
@@ -1469,7 +1469,6 @@
//===--------------------------------------------------------------------===//
// 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 @@
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);
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=111796&r1=111795&r2=111796&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Mon Aug 23 01:53:58 2010
@@ -127,7 +127,7 @@
// 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 @@
///
/// \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 @@
/// 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 @@
// Handle the template <...> part.
SourceLocation TemplateLoc = ConsumeToken();
- TemplateParameterList TemplateParams;
+ llvm::SmallVector<Decl*,8> TemplateParams;
SourceLocation LAngleLoc, RAngleLoc;
{
ParseScope TemplateParmScope(this, Scope::TemplateParamScope);
More information about the cfe-commits
mailing list