[clang] [analyzer] Accept C library functions from the `std` namespace (PR #84469)

Kristóf Umann via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 04:33:42 PST 2024


================
@@ -41,12 +41,8 @@ class CallDescription {
     ///  - We also accept calls where the number of arguments or parameters is
     ///    greater than the specified value.
     /// For the exact heuristics, see CheckerContext::isCLibraryFunction().
-    /// Note that functions whose declaration context is not a TU (e.g.
-    /// methods, functions in namespaces) are not accepted as C library
-    /// functions.
-    /// FIXME: If I understand it correctly, this discards calls where C++ code
-    /// refers a C library function through the namespace `std::` via headers
-    /// like <cstdlib>.
+    /// (This mode only matches functions that are declared either directly
+    /// within a TU or in the namespace `std`.)
----------------
Szelethus wrote:

Might as well go the extra mile and mention an example, like `std::malloc`.

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


More information about the cfe-commits mailing list