This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Adjust extension warnings for #warning
ClosedPublic

Authored by cor3ntin on Jul 23 2022, 2:10 AM.

Details

Summary

The #warning directive is standard in C++2b and C2x,
this adjusts the pedantic and extensions warning accordingly.

Diff Detail

Event Timeline

cor3ntin created this revision.Jul 23 2022, 2:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2022, 2:10 AM
cor3ntin requested review of this revision.Jul 23 2022, 2:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2022, 2:10 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin updated this revision to Diff 447048.Jul 23 2022, 2:11 AM

Formatting

cor3ntin updated this revision to Diff 447049.Jul 23 2022, 2:49 AM

Update release notes.

aaron.ballman accepted this revision.Jul 23 2022, 5:00 AM

LGTM!

clang/include/clang/Basic/DiagnosticLexKinds.td
393–398

<Not Your Problem>Someday, it would be nice if we made the tablegen for diagnostics a wee bit smarter so that we don't need to use two separate warning declarations for this situation. In fact, it'd be nice if tablegen could just automate this pattern given how often we use it and will be using it in the future.</Not Your Problem>

clang/lib/Lex/PPDirectives.cpp
1264–1274

Similarly (and also not your problem), it'd be nice to have a helper function so that we don't need this complicated of a dance to diagnose the situation.

This revision is now accepted and ready to land.Jul 23 2022, 5:00 AM
cor3ntin added inline comments.Jul 23 2022, 5:02 AM
clang/include/clang/Basic/DiagnosticLexKinds.td
393–398

That would be great indeed!

clang/lib/Lex/PPDirectives.cpp
1264–1274

Agreed!

This revision was landed with ongoing or failed builds.Jul 23 2022, 5:10 AM
This revision was automatically updated to reflect the committed changes.