[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 11 07:11:16 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 86ef039220de4b7d2e2f1d5e93874ae7a242730e 4c05d54e07d4f650bf5694a3ddc365078b854627 -- clang/lib/Sema/SemaCoroutine.cpp clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaInit.cpp clang/test/SemaCXX/coro-lifetimebound.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp
index 0b03ca4ea1..ef08e1ee75 100644
--- a/clang/lib/Sema/SemaCoroutine.cpp
+++ b/clang/lib/Sema/SemaCoroutine.cpp
@@ -303,7 +303,7 @@ static void handleGetReturnObject(Sema &S, MemberExpr *ME) {
if (!ME || !ME->getMemberDecl() || !ME->getMemberDecl()->getAsFunction())
return;
auto *MD = ME->getMemberDecl()->getAsFunction();
- auto* RetType = MD->getReturnType()->getAsRecordDecl();
+ auto *RetType = MD->getReturnType()->getAsRecordDecl();
if (!RetType || !RetType->hasAttr<CoroReturnTypeAttr>())
return;
// `get_return_object` should be allowed to return coro_return_type.
``````````
</details>
https://github.com/llvm/llvm-project/pull/77066
More information about the cfe-commits
mailing list