This is an archive of the discontinued LLVM Phabricator instance.

Create specialization of `-Wgnu-statement-expression` for expressions found in macros.
ClosedPublic

Authored by mwyman on May 26 2022, 11:00 PM.

Details

Summary

-Wgnu-statement-expression currently warns for both direct source uses of statement expressions but also macro expansions; since they may be used by macros to avoid multiple evaluation of macro arguments, engineers might want to suppress warnings when statement expressions are expanded from macros but see them if introduced directly in source code.

This change adds the warning flag -Wgnu-statement-expression-from-macro-expansion to enable/disable diagnostics generated from macro expansions.

Diff Detail

Event Timeline

mwyman created this revision.May 26 2022, 11:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 11:00 PM
mwyman requested review of this revision.May 26 2022, 11:00 PM
mwyman updated this revision to Diff 432471.May 26 2022, 11:41 PM
dmaclach accepted this revision.May 27 2022, 11:54 AM
This revision is now accepted and ready to land.May 27 2022, 11:54 AM
mwyman edited the summary of this revision. (Show Details)May 27 2022, 1:26 PM