[libcxx-commits] [libcxx] [libc++][unique_ptr] Implement LWG 4144: Disallow unique_ptr<T&, D> (PR #209018)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 12 06:35:26 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 h,cpp -- libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/non_pointable.single.verify.cpp libcxx/include/__memory/unique_ptr.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/std/utilities/smartptr/unique.ptr/unique.ptr.class/non_pointable.single.verify.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/non_pointable.single.verify.cpp
index 22737598e..148296298 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/non_pointable.single.verify.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/non_pointable.single.verify.cpp
@@ -27,9 +27,7 @@ struct Deleter {
 typedef void Function();
 typedef void AbominableFunction() const;
 
-void pointable_function_type() {
-  (void)sizeof(std::unique_ptr<Function, Deleter>);
-}
+void pointable_function_type() { (void)sizeof(std::unique_ptr<Function, Deleter>); }
 
 void reference_type() {
   // expected-error-re@*:* {{static assertion failed {{.*}}unique_ptr<T, D> requires T* to be a valid type}}

``````````

</details>


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


More information about the libcxx-commits mailing list