@@ -112,7 +112,7 @@ Parser::ParseTemplateDeclarationOrSpecialization(unsigned Context,
112
112
113
113
// Parse the '<' template-parameter-list '>'
114
114
SourceLocation LAngleLoc, RAngleLoc;
115
- SmallVector<Decl *, 4 > TemplateParams;
115
+ SmallVector<NamedDecl *, 4 > TemplateParams;
116
116
if (ParseTemplateParameters (CurTemplateDepthTracker.getDepth (),
117
117
TemplateParams, LAngleLoc, RAngleLoc)) {
118
118
// Skip until the semi-colon or a '}'.
@@ -329,10 +329,9 @@ Parser::ParseSingleDeclarationAfterTemplate(
329
329
// / that enclose this template parameter list.
330
330
// /
331
331
// / \returns true if an error occurred, false otherwise.
332
- bool Parser::ParseTemplateParameters (unsigned Depth,
333
- SmallVectorImpl<Decl*> &TemplateParams,
334
- SourceLocation &LAngleLoc,
335
- SourceLocation &RAngleLoc) {
332
+ bool Parser::ParseTemplateParameters (
333
+ unsigned Depth, SmallVectorImpl<NamedDecl *> &TemplateParams,
334
+ SourceLocation &LAngleLoc, SourceLocation &RAngleLoc) {
336
335
// Get the template parameter list.
337
336
if (!TryConsumeToken (tok::less, LAngleLoc)) {
338
337
Diag (Tok.getLocation (), diag::err_expected_less_after) << " template" ;
@@ -370,11 +369,12 @@ bool Parser::ParseTemplateParameters(unsigned Depth,
370
369
// / template-parameter-list ',' template-parameter
371
370
bool
372
371
Parser::ParseTemplateParameterList (unsigned Depth,
373
- SmallVectorImpl<Decl *> &TemplateParams) {
372
+ SmallVectorImpl<NamedDecl *> &TemplateParams) {
374
373
while (1 ) {
374
+ // FIXME: ParseTemplateParameter should probably just return a NamedDecl.
375
375
if (Decl *TmpParam
376
376
= ParseTemplateParameter (Depth, TemplateParams.size ())) {
377
- TemplateParams.push_back (TmpParam);
377
+ TemplateParams.push_back (dyn_cast<NamedDecl>( TmpParam) );
378
378
} else {
379
379
// If we failed to parse a template parameter, skip until we find
380
380
// a comma or closing brace.
@@ -569,7 +569,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {
569
569
570
570
// Handle the template <...> part.
571
571
SourceLocation TemplateLoc = ConsumeToken ();
572
- SmallVector<Decl *,8 > TemplateParams;
572
+ SmallVector<NamedDecl *,8 > TemplateParams;
573
573
SourceLocation LAngleLoc, RAngleLoc;
574
574
{
575
575
ParseScope TemplateParmScope (this , Scope::TemplateParamScope);
0 commit comments