[libcxx-commits] [libcxx] [libc++] Add [[clang::lifetimebound]] to std::identity (PR #165854)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 31 04:12:41 PDT 2025
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 h,cpp -- libcxx/test/libcxx/utilities/function.objects/lifetimebound.verify.cpp libcxx/include/__functional/identity.h --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/libcxx/test/libcxx/utilities/function.objects/lifetimebound.verify.cpp b/libcxx/test/libcxx/utilities/function.objects/lifetimebound.verify.cpp
index 0ca6007de..74e152c54 100644
--- a/libcxx/test/libcxx/utilities/function.objects/lifetimebound.verify.cpp
+++ b/libcxx/test/libcxx/utilities/function.objects/lifetimebound.verify.cpp
@@ -14,5 +14,6 @@
#include "test_macros.h"
void func() {
- auto&& v1 = std::identity()(1); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v1 = std::identity()(
+ 1); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/165854
More information about the libcxx-commits
mailing list