[clang] Propagate lifetimebound from formal parameters to those in the canonical declaration and use that for analysis (PR #107627)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 13:33:16 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 c014db47ca298ad7a0f52a57c3bfc2a9914371b2 4c0561d79eedc7060597aa33bfb6e41a64df340c --extensions cpp -- clang/lib/Sema/CheckExprLifetime.cpp clang/lib/Sema/SemaAttr.cpp clang/test/SemaCXX/attr-lifetimebound.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Sema/CheckExprLifetime.cpp b/clang/lib/Sema/CheckExprLifetime.cpp
index 3224469c6c..03e91f2628 100644
--- a/clang/lib/Sema/CheckExprLifetime.cpp
+++ b/clang/lib/Sema/CheckExprLifetime.cpp
@@ -463,8 +463,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call,
   }
 
   const FunctionDecl *CanonCallee = Callee->getCanonicalDecl();
-  const unsigned int NP = std::min(Callee->getNumParams(),
-                                   CanonCallee->getNumParams());
+  const unsigned int NP =
+      std::min(Callee->getNumParams(), CanonCallee->getNumParams());
   for (unsigned I = 0, N = std::min<unsigned>(NP, Args.size()); I != N; ++I) {
     if (CheckCoroCall ||
         CanonCallee->getParamDecl(I)->hasAttr<LifetimeBoundAttr>())

``````````

</details>


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


More information about the cfe-commits mailing list