Skip to content

Commit ab6ad40

Browse files
committed
[IDE] Consume identifier and ')' after parenthesized modifier
This fixes an issue where valid parenthesized modifiers like nonisolated(unsafe) get misinterpreted as function calls.
1 parent 9767cc1 commit ab6ad40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5718,8 +5718,8 @@ consumeIfParenthesizedModifier(Parser &P, StringRef name,
57185718
std::find(allowedArguments.begin(), allowedArguments.end(),
57195719
P.Tok.getText()) != allowedArguments.end();
57205720

5721-
if (argumentIsAllowed && P.Tok.is(tok::identifier) &&
5722-
P.peekToken().is(tok::r_paren)) {
5721+
if (argumentIsAllowed && P.consumeIf(tok::identifier) &&
5722+
P.consumeIf(tok::r_paren)) {
57235723
backtrack.cancelBacktrack();
57245724
return true;
57255725
}

0 commit comments

Comments
 (0)