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

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 04:21:20 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 6a0618a0289cb0c23ef3e5c820418650cc1d0fdc c357aa998204e6693430c801f5b7d3a9e5e09e37 -- clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp b/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
index c1ae9b441d..a67b44724b 100644
--- a/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
@@ -92,7 +92,7 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD,
   // case) or they are accessed through the namespace `std::` (when they are
   // used in C++ via headers like <cstdlib>).
   if (!FD->getDeclContext()->getRedeclContext()->isTranslationUnit() &&
-          !AnalysisDeclContext::isInStdNamespace(FD))
+      !AnalysisDeclContext::isInStdNamespace(FD))
     return false;
 
   // If this function is not externally visible, it is not a C library function.

``````````

</details>


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


More information about the cfe-commits mailing list