aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-24 02:52:09 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-24 02:52:09 +0000
commitc4b4e7b8f6ca9b036824e048af49cd2a52b57cdf (patch)
tree9f49436d6c7742234922d2fe5d16f29ade8c0edb /lib/Parse/ParseDecl.cpp
parent07603aa9e57dc13889dd330cd29159003f1c45c3 (diff)
Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 213a210b9e..c7f92cf014 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -419,7 +419,8 @@ void Parser::ParseSpecifierQualifierList(DeclSpec &DS) {
/// [C++] 'virtual'
/// [C++] 'explicit'
///
-void Parser::ParseDeclarationSpecifiers(DeclSpec &DS)
+void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
+ TemplateParameterLists *TemplateParams)
{
DS.SetRangeStart(Tok.getLocation());
while (1) {
@@ -436,7 +437,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS)
default:
// Try to parse a type-specifier; if we found one, continue. If it's not
// a type, this falls through.
- if (MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) {
+ if (MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec, TemplateParams)) {
continue;
}
@@ -661,7 +662,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS)
/// [OBJC] class-name objc-protocol-refs[opt] [TODO]
/// [OBJC] typedef-name objc-protocol-refs[opt] [TODO]
bool Parser::MaybeParseTypeSpecifier(DeclSpec &DS, int& isInvalid,
- const char *&PrevSpec) {
+ const char *&PrevSpec,
+ TemplateParameterLists *TemplateParams) {
// Annotate typenames and C++ scope specifiers.
TryAnnotateTypeOrScopeToken();
@@ -748,7 +750,7 @@ bool Parser::MaybeParseTypeSpecifier(DeclSpec &DS, int& isInvalid,
case tok::kw_class:
case tok::kw_struct:
case tok::kw_union:
- ParseClassSpecifier(DS);
+ ParseClassSpecifier(DS, TemplateParams);
return true;
// enum-specifier:
@@ -1036,7 +1038,8 @@ void Parser::ParseEnumSpecifier(DeclSpec &DS) {
else
TK = Action::TK_Reference;
DeclTy *TagDecl = Actions.ActOnTag(CurScope, DeclSpec::TST_enum, TK, StartLoc,
- SS, Name, NameLoc, Attr);
+ SS, Name, NameLoc, Attr,
+ Action::MultiTemplateParamsArg(Actions));
if (Tok.is(tok::l_brace))
ParseEnumBody(StartLoc, TagDecl);