This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] [clangd] Avoid multi-line diagnostic range for else-after-return diagnostic
ClosedPublic

Authored by nridge on Nov 28 2020, 4:57 PM.

Diff Detail

Event Timeline

nridge created this revision.Nov 28 2020, 4:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2020, 4:57 PM
nridge requested review of this revision.Nov 28 2020, 4:57 PM

I see that you have a more sophisticated fix at D91149. Will leave it up to you if we should just wait for that to land, or land this in the interim.

This small fix is definitely worth while, the more involved patch may not ever land.

clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
324

There are more places where diag is called. Maybe add this to all callsites of diag that then emit fixes, otherwise this may miss a few cases.

clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
488

This needs rebasing, clang tidy interface for checks has changed.

nridge updated this revision to Diff 308235.Nov 29 2020, 2:57 PM

Rebase and address review comment

This revision is now accepted and ready to land.Nov 29 2020, 3:26 PM