@@ -4424,7 +4424,7 @@ void Parser::diagnoseConsecutiveIDs(StringRef First, SourceLoc FirstLoc,
4424
4424
4425
4425
// / Parse a Decl item in decl list.
4426
4426
ParserStatus Parser::parseDeclItem (bool &PreviousHadSemi,
4427
- Parser:: ParseDeclOptions Options,
4427
+ ParseDeclOptions Options,
4428
4428
llvm::function_ref<void (Decl*)> handler) {
4429
4429
if (Tok.is (tok::semi)) {
4430
4430
// Consume ';' without preceding decl.
@@ -5008,7 +5008,7 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
5008
5008
// Parse a 'where' clause if present, adding it to our GenericParamList.
5009
5009
if (Tok.is (tok::kw_where)) {
5010
5010
ContextChange CC (*this , TAD);
5011
- Status |= parseFreestandingGenericWhereClause (genericParams);
5011
+ Status |= parseFreestandingGenericWhereClause (TAD, genericParams, Flags );
5012
5012
}
5013
5013
5014
5014
if (UnderlyingTy.isNull ()) {
@@ -6348,7 +6348,7 @@ ParserResult<FuncDecl> Parser::parseDeclFunc(SourceLoc StaticLoc,
6348
6348
if (Tok.is (tok::kw_where)) {
6349
6349
ContextChange CC (*this , FD);
6350
6350
6351
- Status |= parseFreestandingGenericWhereClause (GenericParams);
6351
+ Status |= parseFreestandingGenericWhereClause (FD, GenericParams, Flags );
6352
6352
if (Status.hasCodeCompletion () && !CodeCompletion) {
6353
6353
// Trigger delayed parsing, no need to continue.
6354
6354
return Status;
@@ -6603,12 +6603,13 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
6603
6603
6604
6604
// Parse a 'where' clause if present, adding it to our GenericParamList.
6605
6605
if (Tok.is (tok::kw_where)) {
6606
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
6607
- Status |= whereStatus ;
6606
+ auto whereStatus =
6607
+ parseFreestandingGenericWhereClause (ED, GenericParams, Flags) ;
6608
6608
if (whereStatus.hasCodeCompletion () && !CodeCompletion) {
6609
6609
// Trigger delayed parsing, no need to continue.
6610
6610
return whereStatus;
6611
6611
}
6612
+ Status |= whereStatus;
6612
6613
}
6613
6614
6614
6615
SyntaxParsingContext BlockContext (SyntaxContext, SyntaxKind::MemberDeclBlock);
@@ -6889,12 +6890,13 @@ ParserResult<StructDecl> Parser::parseDeclStruct(ParseDeclOptions Flags,
6889
6890
6890
6891
// Parse a 'where' clause if present, adding it to our GenericParamList.
6891
6892
if (Tok.is (tok::kw_where)) {
6892
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
6893
- Status |= whereStatus ;
6893
+ auto whereStatus =
6894
+ parseFreestandingGenericWhereClause (SD, GenericParams, Flags) ;
6894
6895
if (whereStatus.hasCodeCompletion () && !CodeCompletion) {
6895
6896
// Trigger delayed parsing, no need to continue.
6896
6897
return whereStatus;
6897
6898
}
6899
+ Status |= whereStatus;
6898
6900
}
6899
6901
6900
6902
// Make the entities of the struct as a code block.
@@ -7005,12 +7007,13 @@ ParserResult<ClassDecl> Parser::parseDeclClass(ParseDeclOptions Flags,
7005
7007
7006
7008
// Parse a 'where' clause if present, adding it to our GenericParamList.
7007
7009
if (Tok.is (tok::kw_where)) {
7008
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
7009
- Status |= whereStatus ;
7010
+ auto whereStatus =
7011
+ parseFreestandingGenericWhereClause (CD, GenericParams, Flags) ;
7010
7012
if (whereStatus.hasCodeCompletion () && !CodeCompletion) {
7011
7013
// Trigger delayed parsing, no need to continue.
7012
7014
return whereStatus;
7013
7015
}
7016
+ Status |= whereStatus;
7014
7017
}
7015
7018
7016
7019
SyntaxParsingContext BlockContext (SyntaxContext, SyntaxKind::MemberDeclBlock);
@@ -7257,7 +7260,8 @@ Parser::parseDeclSubscript(SourceLoc StaticLoc,
7257
7260
if (Tok.is (tok::kw_where)) {
7258
7261
ContextChange CC (*this , Subscript);
7259
7262
7260
- Status |= parseFreestandingGenericWhereClause (GenericParams);
7263
+ Status |= parseFreestandingGenericWhereClause (Subscript, GenericParams,
7264
+ Flags);
7261
7265
if (Status.hasCodeCompletion () && !CodeCompletion) {
7262
7266
// Trigger delayed parsing, no need to continue.
7263
7267
return Status;
@@ -7399,7 +7403,7 @@ Parser::parseDeclInit(ParseDeclOptions Flags, DeclAttributes &Attributes) {
7399
7403
if (Tok.is (tok::kw_where)) {
7400
7404
ContextChange (*this , CD);
7401
7405
7402
- Status |= parseFreestandingGenericWhereClause (GenericParams);
7406
+ Status |= parseFreestandingGenericWhereClause (CD, GenericParams, Flags );
7403
7407
if (Status.hasCodeCompletion () && !CodeCompletion) {
7404
7408
// Trigger delayed parsing, no need to continue.
7405
7409
return Status;
0 commit comments