[clang] Control analysis-based diagnostics with #pragma (PR #136323)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 18 09:36:02 PDT 2025


================
@@ -1202,6 +1202,30 @@ Clang also allows you to push and pop the current warning state. This is
 particularly useful when writing a header file that will be compiled by
 other people, because you don't know what warning flags they build with.
 
+Note that the following diagnostic groups, which are ones based on analyzing
----------------
erichkeane wrote:

Ooof... this is a shocking/bad behavior.  I wish we could do better, but I of course know we probably couldn't?  UNLESS... we set the 'state' of the warning on the function during evaluation of the pragma, then checked that flag AS WELL at the end of TU to enable them?

Not sure if we want to do that in THIS patch, but an issue report with this idea isn't perhaps a terribad idea.

https://github.com/llvm/llvm-project/pull/136323


More information about the cfe-commits mailing list