Create specialization of -Wgnu-statement-expression for expressions found in macros.
authorMichael Wyman <michael@mwyman.com>
Fri, 27 May 2022 05:39:04 +0000 (22:39 -0700)
committerMichael Wyman <michael@mwyman.com>
Tue, 31 May 2022 18:13:08 +0000 (11:13 -0700)
commit7689c7fc9e08cc430daca3714bcffdd00fd538bd
treeb88cad934f4d163ad84868364f2039c033d5143a
parentfa958c3a94d3469ee24a9e646629251e8cd90efd
Create specialization of -Wgnu-statement-expression for expressions found in macros.

-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.

Differential Revision: https://reviews.llvm.org/D126522
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/lib/Parse/ParseExpr.cpp
clang/test/Sema/gnu-flags.c