@@ -167,9 +167,13 @@ Parser::DeclGroupPtrTy Parser::ParseTemplateDeclarationOrSpecialization(
167
167
LastParamListWasEmpty);
168
168
169
169
// Parse the actual template declaration.
170
- if (Tok.is (tok::kw_concept))
171
- return Actions.ConvertDeclToDeclGroup (
172
- ParseConceptDefinition (TemplateInfo, DeclEnd));
170
+ if (Tok.is (tok::kw_concept)) {
171
+ Decl *ConceptDecl = ParseConceptDefinition (TemplateInfo, DeclEnd);
172
+ // We need to explicitly pass ConceptDecl to ParsingDeclRAIIObject, so that
173
+ // delayed diagnostics (e.g. warn_deprecated) have a Decl to work with.
174
+ ParsingTemplateParams.complete (ConceptDecl);
175
+ return Actions.ConvertDeclToDeclGroup (ConceptDecl);
176
+ }
173
177
174
178
return ParseDeclarationAfterTemplate (
175
179
Context, TemplateInfo, ParsingTemplateParams, DeclEnd, AccessAttrs, AS);
@@ -316,7 +320,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo &TemplateInfo,
316
320
const IdentifierInfo *Id = Result.Identifier ;
317
321
SourceLocation IdLoc = Result.getBeginLoc ();
318
322
319
- DiagnoseAndSkipCXX11Attributes ();
323
+ ParsedAttributes Attrs (AttrFactory);
324
+ MaybeParseAttributes (PAKM_GNU | PAKM_CXX11, Attrs);
320
325
321
326
if (!TryConsumeToken (tok::equal)) {
322
327
Diag (Tok.getLocation (), diag::err_expected) << tok::equal;
@@ -335,8 +340,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo &TemplateInfo,
335
340
ExpectAndConsumeSemi (diag::err_expected_semi_declaration);
336
341
Expr *ConstraintExpr = ConstraintExprResult.get ();
337
342
return Actions.ActOnConceptDefinition (getCurScope (),
338
- *TemplateInfo.TemplateParams ,
339
- Id, IdLoc, ConstraintExpr );
343
+ *TemplateInfo.TemplateParams , Id, IdLoc,
344
+ ConstraintExpr, Attrs );
340
345
}
341
346
342
347
// / ParseTemplateParameters - Parses a template-parameter-list enclosed in
0 commit comments