[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

Ryosuke Niwa via cfe-commits cfe-commits at lists.llvm.org
Sun May 12 14:18:03 PDT 2024


rniwa wrote:

> You should add a test for mutually recursive functions. I suspect something like this doesn't work:
> 
> ```c++
>     int non_trivial();
>     int f(bool b) { return g(!b) + non_trivial(); }
>     int g(bool b) { return b ? f(b) : 1; }
>     
> getFieldTrivial().f(true);  // expected-warning {{...}}
> getFieldTrivial().g(true);  // expected-warning {{...}}
> ```

Duh, of course. Thanks for pointing out the obvious flaw.

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


More information about the cfe-commits mailing list