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

2024-03-08 Thread Gábor Horváth via cfe-commits
Xazax-hun wrote: Once the other reviewers are happy, this looks good to me! https://github.com/llvm/llvm-project/pull/84469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-08 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: > I feel that I'm getting bogged down in this area with changes that are more > general than what's strictly necessary and only tangentially related to my > real goals... > > I'm not familiar with the u

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

2024-03-08 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: NagyDonat wrote: I feel that I'm getting bogged down in this area with changes that are more general than what's strictly necessary... I'm not familiar with the unittest framework and if unittests were necessary for th

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

2024-03-08 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal commented: Looks good to me, but I'd be more eased if had seen some unittests for this matter. You could use AST-matchers selecting different FunctionDecls and query them using this free-func

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

2024-03-08 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -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, s

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

2024-03-08 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: NagyDonat wrote: Currently MallocChecker doesn't use this `CDM::CLibrary` mode in the `CallDescription` for `malloc` -- because before this commit it would've been incorrect to use it. I'm planning to ensure that functi

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

2024-03-08 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/84469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-08 Thread Kristóf Umann via cfe-commits
@@ -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

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

2024-03-08 Thread Kristóf Umann via cfe-commits
@@ -87,9 +87,11 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD, if (!II) return false; - // Look through 'extern "C"' and anything similar invented in the future. - // If this function is not in TU directly, it is not a C library function. - if (!F

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

2024-03-08 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus commented: Makes perfect sense to me. Can you add a testcase for `std::malloc` or something similar? https://github.com/llvm/llvm-project/pull/84469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

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

2024-03-08 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/84469 >From c357aa998204e6693430c801f5b7d3a9e5e09e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Fri, 8 Mar 2024 13:0

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

2024-03-08 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/84469 >From c357aa998204e6693430c801f5b7d3a9e5e09e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Fri, 8 Mar 2024 13:06:01 +0100 Subject: [PATC

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

2024-03-08 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 6a0618a0289cb0c23ef3e5c820418650cc1d0fdc c357aa998204e6693430c801f5b7d3a9e5e09e37 --

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

2024-03-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (NagyDonat) Changes Previously, the function `isCLibraryFunction()` and logic relying on it only accepted functions that are declared directly within a TU (i.e. not in a namespace or a class). However C++ headers like decla

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

2024-03-08 Thread via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/84469 Previously, the function `isCLibraryFunction()` and logic relying on it only accepted functions that are declared directly within a TU (i.e. not in a namespace or a class). However C++ headers like declare ma