[clang] [LifetimeSafety] Use buildOriginFlowChain for remaining diagnostics in issuePendingWarnings (PR #212083)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 17 18:45:01 PDT 2026
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 origin/main HEAD --extensions cpp,h -- clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeSafety.h clang/include/clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h clang/lib/Analysis/LifetimeSafety/Checker.cpp clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp clang/lib/Sema/SemaLifetimeSafety.h clang/test/Sema/LifetimeSafety/annotation-suggestions.cpp clang/test/Sema/LifetimeSafety/capture-by.cpp clang/test/Sema/LifetimeSafety/dangling-field.cpp clang/test/Sema/LifetimeSafety/dangling-global.cpp clang/test/Sema/LifetimeSafety/invalidations.cpp clang/test/Sema/LifetimeSafety/nocfg.cpp clang/test/Sema/LifetimeSafety/safety.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Analysis/LifetimeSafety/Checker.cpp b/clang/lib/Analysis/LifetimeSafety/Checker.cpp
index a5fdcf677..9d8899eb5 100644
--- a/clang/lib/Analysis/LifetimeSafety/Checker.cpp
+++ b/clang/lib/Analysis/LifetimeSafety/Checker.cpp
@@ -372,7 +372,8 @@ public:
if (const auto *Func = dyn_cast_if_present<FunctionDecl>(FD))
IsMain = Func->isMain();
SemaHelper->reportDanglingGlobal(IssueExpr, GlobalEscape->getGlobal(),
- MovedExpr, ExpiryLoc, ExprChain, IsMain);
+ MovedExpr, ExpiryLoc, ExprChain,
+ IsMain);
} else
llvm_unreachable("Unhandled OriginEscapesFact type");
} else
``````````
</details>
https://github.com/llvm/llvm-project/pull/212083
More information about the cfe-commits
mailing list