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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 12 18:25:25 PDT 2026


================
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// A program that instantiates the definition of unique_ptr<T, D> is ill-formed if T* is an invalid type.
+
+// LWG 4144
+
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
+#include <memory>
+
+struct Deleter {
+  typedef int* pointer;
+
+  void operator()(pointer) const;
+};
+
+typedef void Function();
+typedef void AbominableFunction() const;
+
+void pointable_function_type() { (void)sizeof(std::unique_ptr<Function, Deleter>); }
----------------
frederick-vs-ja wrote:

`typedef void Function();` also seems to be unrelated.

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


More information about the libcxx-commits mailing list