This is an archive of the discontinued LLVM Phabricator instance.

[clang][Diagnostics] Fix diagnostic line numbers
ClosedPublic

Authored by tbaeder on Jun 27 2023, 2:35 AM.

Details

Summary
The first line of the code snippet we print is potentially lower than
the caret line, so handle that case.

Fixes https://github.com/llvm/llvm-project/issues/63524

Diff Detail

Event Timeline

tbaeder created this revision.Jun 27 2023, 2:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 2:35 AM
tbaeder requested review of this revision.Jun 27 2023, 2:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 2:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cjdb added a comment.Jun 29 2023, 10:14 AM

LGTM. Not sure if the Fixes https://github.com/llvm/llvm-project/issues/63524 line autocloses the issue, but note that Fixes #63524 does.

That works as well as far as I know, but I changed it locally to just use the issue ID anyway. Could you set the status to accepted? Thanks.

cor3ntin accepted this revision.Jun 30 2023, 1:17 AM
This revision is now accepted and ready to land.Jun 30 2023, 1:17 AM

@cor3ntin Thanks. You're very close to getting on my default reviewer list though, so be careful ;)

@cor3ntin Thanks. You're very close to getting on my default reviewer list though, so be careful ;)

Thanks for the heads up, I might add you to mine :D

This revision was landed with ongoing or failed builds.Jun 30 2023, 1:57 AM
This revision was automatically updated to reflect the committed changes.