This is an archive of the discontinued LLVM Phabricator instance.

[clang/Diagnostic] Use `optional` to disambiguate between a `StoredDiagMessage` that is not set vs set as empty string
ClosedPublic

Authored by akyrtzi on Mar 3 2023, 10:48 AM.

Details

Summary

"But when would you have a completely empty diagnostic message", you ask dear reader?
That is when there is an empty "#warning" in code.

rdar://106155415

Diff Detail

Event Timeline

akyrtzi created this revision.Mar 3 2023, 10:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 10:48 AM
akyrtzi requested review of this revision.Mar 3 2023, 10:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 10:48 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Mar 3 2023, 11:20 AM
akyrtzi updated this revision to Diff 502201.Mar 3 2023, 11:29 AM

Avoid passing a new IgnoringDiagConsumer for the test since it's unused.

"But when would you have a completely empty diagnostic message", you ask dear reader?
That is when there is an empty "#warning" in code.

Is this observable from a clang command line tool? Be nice to have a lit test.

Is this observable from a clang command line tool? Be nice to have a lit test.

Added lit test here: https://reviews.llvm.org/D145473