AccessSpecifier AS=AS_none,
AttributeList *AccessAttrs = nullptr);
bool ParseTemplateParameters(unsigned Depth,
- SmallVectorImpl<Decl*> &TemplateParams,
+ SmallVectorImpl<NamedDecl *> &TemplateParams,
SourceLocation &LAngleLoc,
SourceLocation &RAngleLoc);
bool ParseTemplateParameterList(unsigned Depth,
- SmallVectorImpl<Decl*> &TemplateParams);
+ SmallVectorImpl<NamedDecl*> &TemplateParams);
bool isStartOfTemplateTypeParameter();
Decl *ParseTemplateParameter(unsigned Depth, unsigned Position);
Decl *ParseTypeParameter(unsigned Depth, unsigned Position);
// Parse the '<' template-parameter-list '>'
SourceLocation LAngleLoc, RAngleLoc;
- SmallVector<Decl*, 4> TemplateParams;
+ SmallVector<NamedDecl*, 4> TemplateParams;
if (ParseTemplateParameters(CurTemplateDepthTracker.getDepth(),
TemplateParams, LAngleLoc, RAngleLoc)) {
// Skip until the semi-colon or a '}'.
/// that enclose this template parameter list.
///
/// \returns true if an error occurred, false otherwise.
-bool Parser::ParseTemplateParameters(unsigned Depth,
- SmallVectorImpl<Decl*> &TemplateParams,
- SourceLocation &LAngleLoc,
- SourceLocation &RAngleLoc) {
+bool Parser::ParseTemplateParameters(
+ unsigned Depth, SmallVectorImpl<NamedDecl *> &TemplateParams,
+ SourceLocation &LAngleLoc, SourceLocation &RAngleLoc) {
// Get the template parameter list.
if (!TryConsumeToken(tok::less, LAngleLoc)) {
Diag(Tok.getLocation(), diag::err_expected_less_after) << "template";
/// template-parameter-list ',' template-parameter
bool
Parser::ParseTemplateParameterList(unsigned Depth,
- SmallVectorImpl<Decl*> &TemplateParams) {
+ SmallVectorImpl<NamedDecl*> &TemplateParams) {
while (1) {
+ // FIXME: ParseTemplateParameter should probably just return a NamedDecl.
if (Decl *TmpParam
= ParseTemplateParameter(Depth, TemplateParams.size())) {
- TemplateParams.push_back(TmpParam);
+ TemplateParams.push_back(dyn_cast<NamedDecl>(TmpParam));
} else {
// If we failed to parse a template parameter, skip until we find
// a comma or closing brace.
// Handle the template <...> part.
SourceLocation TemplateLoc = ConsumeToken();
- SmallVector<Decl*,8> TemplateParams;
+ SmallVector<NamedDecl*,8> TemplateParams;
SourceLocation LAngleLoc, RAngleLoc;
{
ParseScope TemplateParmScope(this, Scope::TemplateParamScope);
SourceLocation ExportLoc,
SourceLocation TemplateLoc,
SourceLocation LAngleLoc,
- ArrayRef<Decl *> Params,
+ ArrayRef<NamedDecl *> Params,
SourceLocation RAngleLoc,
Expr *RequiresClause) {
if (ExportLoc.isValid())
return TemplateParameterList::Create(
Context, TemplateLoc, LAngleLoc,
- llvm::makeArrayRef((NamedDecl *const *)Params.data(), Params.size()),
+ llvm::makeArrayRef(Params.data(), Params.size()),
RAngleLoc, RequiresClause);
}