diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-24 02:52:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-24 02:52:09 +0000 |
commit | b9bd8a994c8c871faf338649438a3409f67da394 (patch) | |
tree | 38511cc0bc3fd8f00a88a3346fdbe675325a6442 /clang/lib/Parse/ParseDecl.cpp | |
parent | a283f91a67a852c311086298908c49e880a838de (diff) | |
download | bcm5719-llvm-b9bd8a994c8c871faf338649438a3409f67da394.tar.gz bcm5719-llvm-b9bd8a994c8c871faf338649438a3409f67da394.zip |
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
llvm-svn: 61413
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 213a210b9ea..c7f92cf014d 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/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); |