Skip to content

Commit fb0461b

Browse files
committed
[NFC] Tweak source loc of @_implements error
When closing paren is missing, point at the location where it should be found, not the opening paren.
1 parent 3b9e0ee commit fb0461b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,9 +1148,10 @@ Parser::parseImplementsAttribute(SourceLoc AtLoc, SourceLoc Loc) {
11481148
}
11491149

11501150
SourceLoc rParenLoc;
1151-
if (!consumeIf(tok::r_paren, rParenLoc)) {
1152-
diagnose(lParenLoc, diag::attr_expected_rparen, AttrName,
1153-
/*DeclModifier=*/false);
1151+
if (parseMatchingToken(tok::r_paren, rParenLoc,
1152+
{ diag::attr_expected_rparen,
1153+
{ AttrName, /*DeclModifier=*/false } },
1154+
lParenLoc)) {
11541155
Status.setIsParseError();
11551156
}
11561157

0 commit comments

Comments
 (0)