This is an archive of the discontinued LLVM Phabricator instance.

[clang][Diagnostics] Print empty lines in multiline snippets
ClosedPublic

Authored by tbaeder on May 24 2023, 12:05 AM.

Details

Summary

We should preserve empty lines in output snippets.

Diff Detail

Event Timeline

tbaeder created this revision.May 24 2023, 12:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 12:05 AM
tbaeder requested review of this revision.May 24 2023, 12:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 12:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder added inline comments.May 24 2023, 12:30 AM
clang/test/Misc/diag-style.cpp
11

Questionable whether the space after the | is expected.

tbaeder updated this revision to Diff 525050.May 24 2023, 1:03 AM
tbaeder added inline comments.
clang/lib/Frontend/TextDiagnostic.cpp
1228

This is a special case (and probably unneeded?), but otherwise we get 2 empty lines for an empty source line when we print source range info.

aaron.ballman accepted this revision.May 24 2023, 6:07 AM

LGTM!

clang/test/Misc/diag-style.cpp
11

I don't have a good intuition for whether it is expected or not, but I think it's defensible.

This revision is now accepted and ready to land.May 24 2023, 6:07 AM
This revision was landed with ongoing or failed builds.May 31 2023, 1:34 AM
This revision was automatically updated to reflect the committed changes.