[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 07:36:28 PDT 2024


================
@@ -1128,12 +1128,18 @@ def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
 // Uniqueness Analysis warnings
 def Consumed       : DiagGroup<"consumed">;
 
+// Warnings and notes related to the function effects system underlying
+// the nonblocking and nonallocating attributes.
+def FunctionEffects : DiagGroup<"function-effects">;
+def PerfConstraintImpliesNoexcept : DiagGroup<"perf-constraint-implies-noexcept">;
----------------
dougsonos wrote:

My first impulse was to tie them together, but to reason through this...

The argument for not having `-Wfunction-effects` enabled by default is that if I get a new version of a library which has adopted the attributes, I shouldn't immediately get warnings everywhere I use the library.

But I won't get `-Wperf-constraint-implies-noexcept` warnings anywhere until I start adding `[[nonblocking]]` or `[[nonallocating]]` in my own code, so it's reasonable to include that in `-Wall`.

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


More information about the cfe-commits mailing list