[clang] [analyzer] Note last "fclose" call from "ensureStreamOpened" (PR #109112)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 18 03:03:28 PDT 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 0dd56858fe188419182a57d0e03c8cd0aa693867 b5e904ed860c27b03f986c89ffbf373a5910abb1 --extensions c,cpp -- clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp clang/test/Analysis/stream-note.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index a476dbc4a9..0a823a1126 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -1891,8 +1891,7 @@ ProgramStateRef StreamChecker::ensureStreamOpened(SVal StreamVal,
// according to cppreference.com .
if (ExplodedNode *N = C.generateErrorNode()) {
auto R = std::make_unique<PathSensitiveBugReport>(
- BT_UseAfterClose,
- "Use of a stream that might be already closed", N);
+ BT_UseAfterClose, "Use of a stream that might be already closed", N);
R->addVisitor<StreamClosedVisitor>(Sym);
C.emitReport(std::move(R));
return nullptr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/109112
More information about the cfe-commits
mailing list