{"id":2220861,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2220861/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/20260408094553.155396-1-tkaminsk@redhat.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260408094553.155396-1-tkaminsk@redhat.com>","date":"2026-04-08T09:27:41","name":"libstdc++: Remove non_type and replace it with constant_wrapper in function_ref","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a11a5702f7fceb0a090a2e2c93240af4ab121f75","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/1.1/people/90409/?format=json","name":"Tomasz Kamiński","email":"tkaminsk@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/20260408094553.155396-1-tkaminsk@redhat.com/mbox/","series":[{"id":499109,"url":"http://patchwork.ozlabs.org/api/1.1/series/499109/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=499109","date":"2026-04-08T09:27:41","name":"libstdc++: Remove non_type and replace it with constant_wrapper in function_ref","version":1,"mbox":"http://patchwork.ozlabs.org/series/499109/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2220861/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2220861/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ELBEZcJM;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ELBEZcJM","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frJ9x6JJ2z1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 19:46:44 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id AF0354BA2E08\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Apr 2026 09:46:42 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id B2BD44BA2E08\n for <gcc-patches@gcc.gnu.org>; Wed,  8 Apr 2026 09:45:59 +0000 (GMT)","from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-mal7HrnMPUScA3fTyJL-hQ-1; Wed,\n 08 Apr 2026 05:45:57 -0400","from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id EBD131956052; Wed,  8 Apr 2026 09:45:55 +0000 (UTC)","from localhost (unknown [10.44.50.40])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 06D6D19560A6; Wed,  8 Apr 2026 09:45:54 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org AF0354BA2E08","OpenDKIM Filter v2.11.0 sourceware.org B2BD44BA2E08"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org B2BD44BA2E08","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org B2BD44BA2E08","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775641559; cv=none;\n b=dCbrIHQsV+JOsQsicMTqNtGqdy/u5EsThMMF5NzFf0mtuH+n9qX4GvWfKG3frdrGpnwvwmaL/n1kFGQ0QoMtxNa1eQTTQeM7tO9fLb6/HWHLHpHGIa7H8eCnWnijx/La/8UOcLUMjfyVafXF/tt7n2Ice/JAFGiyUILI6K/nR+k=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775641559; c=relaxed/simple;\n bh=OqBl32WJFjGW0x2uSkopYuu5+fXuigsUImIQJo8DDAM=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=KnvKfGWqLt0zMq2oF8/IgvlDJUw7W174kCw8r7X2CPOKkjvgRUA1irGJMH80rPf/QiinHLknz4dtC0BOmbgFdt7aUIAJLXSYzQDp0dsPYWC2i9wvzEPziL/pHYPW6qPXDdUd7qKIJmiBdetUjGm1Ysb+aAqPomd8699ew1FPx8c=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775641559;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=h362T/5TgXYJlX1kbLiMXp02dzG097aRiD9AEwbzb2Q=;\n b=ELBEZcJMOonAThpoMK2yGu66glBZTbOi6U7S5oSmDwXRcBfspAeLExSp+Xr4+xS4gK9oUF\n FrmMM42wpFmpT10O1nsJeX+581Bkl7FiZL6b2fKPec5mi/yJIj77Sj4n2/QDwnjXq5Lb+0\n b7Mld4YP4lzFXOg1VWwsxC9E6QfS6JA=","X-MC-Unique":"mal7HrnMPUScA3fTyJL-hQ-1","X-Mimecast-MFC-AGG-ID":"mal7HrnMPUScA3fTyJL-hQ_1775641556","From":"=?utf-8?q?Tomasz_Kami=C5=84ski?= <tkaminsk@redhat.com>","To":"libstdc++@gcc.gnu.org,\n\tgcc-patches@gcc.gnu.org","Cc":"Matthias Kretz <m.kretz@gsi.de>","Subject":"[PATCH] libstdc++: Remove non_type and replace it with\n constant_wrapper in function_ref","Date":"Wed,  8 Apr 2026 11:27:41 +0200","Message-ID":"<20260408094553.155396-1-tkaminsk@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.12","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"Rmb0ZAOKVv9n1tRYWseynngYc3eRXz4SQZRmulpmYCA_1775641556","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"From: Matthias Kretz <m.kretz@gsi.de>\n\nThis implements P3948R1: constant_wrapper is the only tool needed\nfor passing constant expressions via function arguments.\n\nThis changes function_ref from nontype_t to constant_wrapper and\nimplements the ambiguity check (static_asert in function_ref\nfrom constant_wrapper constructor).\n\nIn addition to P3948R1 this also includes the (forgotten) deduction\nguide changes suggested in the draft PR [1].\n\n[1] https://github.com/cplusplus/draft/pull/8878\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/funcref_impl.h (function_ref::function_ref):\n\tChange nontype_t parameter to constant_wrapper, and adjust\n\taccordingly. Add static_assert detecting ambigous semantics.\n\t(function_refoperator=): Detect constant_wrapper rather than\n\tnontype_t.\n\t* include/bits/funcwrap.h (function_ref): Change\n\t* include/bits/utility.h (std::nontype_t, std::nontype)\n\t(std::__is_nontype_v): Remove.\n\t(_is_constant_wrapper_v): Define.\n\t* src/c++23/std.cc.in (std::nontype_t, std::nontype):\n\tRemove exports.\n\t* testsuite/20_util/function_ref/cw_cons_neg.cc: New tests\n\tfor ambiguity check.\n\t* testsuite/20_util/function_ref/assign.cc: Replace nontype_t\n\twith constant_wrapper and nontype with std::cw.\n\t* testsuite/20_util/function_ref/call.cc: Likewise.\n\t* testsuite/20_util/function_ref/cons.cc: Likewise.\n\t* testsuite/20_util/function_ref/cons_neg.cc: Likewise.\n\t* testsuite/20_util/function_ref/deduction.cc: Likewise.\n\t* testsuite/20_util/function_ref/mutation.cc: Likewise.\n\nCo-authored-by: Tomasz Kamiński <tkaminsk@redhat.com>\nSigned-off-by: Matthias Kretz <m.kretz@gsi.de>\nSigned-off-by: Tomasz Kamiński <tkaminsk@redhat.com>\n---\nThis is based on Matthias patch from formge:\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/147/commits/cac7355bcbd7ea8b5e26f064922e8f4412a4da97\n\nI have applied small adjustment to names and parameter specification,\nto be more consistient with the standard. Outside of that I have reworked\nstatic_assert to reflect more closely what is in the standard, and added\nnegative test (cw_const_neg.cc).\n\nTesting on x86_64-linux. All *function_ref* test already passed in\nall standard modes and with modules. OK for trunk when all test passes?\n\n\n libstdc++-v3/include/bits/funcref_impl.h      | 36 ++++----\n libstdc++-v3/include/bits/funcwrap.h          | 13 +--\n libstdc++-v3/include/bits/utility.h           | 23 ++---\n libstdc++-v3/src/c++23/std.cc.in              |  4 -\n .../testsuite/20_util/function_ref/assign.cc  | 27 +++---\n .../testsuite/20_util/function_ref/call.cc    | 51 ++++++------\n .../testsuite/20_util/function_ref/cons.cc    | 83 +++++++++----------\n .../20_util/function_ref/cons_neg.cc          | 17 ++--\n .../20_util/function_ref/cw_cons_neg.cc       | 35 ++++++++\n .../20_util/function_ref/dangling.cc          |  2 +-\n .../20_util/function_ref/deduction.cc         | 48 +++++------\n .../20_util/function_ref/mutation.cc          |  9 +-\n 12 files changed, 185 insertions(+), 163 deletions(-)\n create mode 100644 libstdc++-v3/testsuite/20_util/function_ref/cw_cons_neg.cc","diff":"diff --git a/libstdc++-v3/include/bits/funcref_impl.h b/libstdc++-v3/include/bits/funcref_impl.h\nindex 3d55c8406b0..9fcab570803 100644\n--- a/libstdc++-v3/include/bits/funcref_impl.h\n+++ b/libstdc++-v3/include/bits/funcref_impl.h\n@@ -129,12 +129,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       // _GLIBCXX_RESOLVE_LIB_DEFECTS\n       // 4256. Incorrect constrains for function_ref constructors from nontype\n       /// Target object is __fn. There is no bound object.\n-      template<auto __fn>\n-\trequires __is_invocable_using<const decltype(__fn)&>\n+      template<auto __cwfn, typename _Fn>\n+\trequires __is_invocable_using<const _Fn&>\n \tconstexpr\n-\tfunction_ref(nontype_t<__fn>) noexcept\n+\tfunction_ref(constant_wrapper<__cwfn, _Fn>) noexcept\n \t{\n-\t  using _Fn = remove_cv_t<decltype(__fn)>;\n+\t  constexpr const _Fn& __fn = constant_wrapper<__cwfn, _Fn>::value;\n+\t  if constexpr (sizeof...(_ArgTypes) > 0)\n+\t    if constexpr ((... && _ConstExprParam<remove_cvref_t<_ArgTypes>>))\n+\t      static_assert(!requires {\n+\t        typename constant_wrapper<\n+\t\t  std::__invoke(__fn, remove_cvref_t<_ArgTypes>::value...)>;\n+\t      }, \"cw<fn>(args...) should be equivalent to fn(args...)\");\n+\n \t  if constexpr (is_pointer_v<_Fn> || is_member_pointer_v<_Fn>)\n \t    static_assert(__fn != nullptr);\n \n@@ -144,13 +151,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \n       /// Target object is equivalent to std::bind_front<_fn>(std::ref(__ref)).\n       /// Bound object is object referenced by second parameter.\n-      template<auto __fn, typename _Up, typename _Td = remove_reference_t<_Up>>\n+      template<auto __cwfn, typename _Fn, typename _Up,\n+\t       typename _Td = remove_reference_t<_Up>>\n \trequires (!is_rvalue_reference_v<_Up&&>)\n-\t  && __is_invocable_using<const decltype(__fn)&, _Td _GLIBCXX_MOF_CV&>\n+\t\t && __is_invocable_using<const _Fn&, _Td _GLIBCXX_MOF_CV&>\n \tconstexpr\n-\tfunction_ref(nontype_t<__fn>, _Up&& __ref) noexcept\n+\tfunction_ref(constant_wrapper<__cwfn, _Fn>, _Up&& __ref) noexcept\n \t{\n-\t  using _Fn = remove_cv_t<decltype(__fn)>;\n+\t  constexpr const _Fn& __fn = constant_wrapper<__cwfn, _Fn>::value;\n \t  if constexpr (is_pointer_v<_Fn> || is_member_pointer_v<_Fn>)\n \t    static_assert(__fn != nullptr);\n \n@@ -166,12 +174,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \n       /// Target object is equivalent to std::bind_front<_fn>(__ptr).\n       /// Bound object is object pointed by second parameter (if any).\n-      template<auto __fn, typename _Td>\n-\trequires __is_invocable_using<const decltype(__fn)&, _Td _GLIBCXX_MOF_CV*>\n+      template< auto __cwfn, typename _Fn, typename _Td>\n+\trequires __is_invocable_using<const _Fn&, _Td _GLIBCXX_MOF_CV*>\n \tconstexpr\n-\tfunction_ref(nontype_t<__fn>, _Td _GLIBCXX_MOF_CV* __ptr) noexcept\n+\tfunction_ref(constant_wrapper<__cwfn, _Fn>, _Td _GLIBCXX_MOF_CV* __ptr) noexcept\n \t{\n-\t  using _Fn = remove_cv_t<decltype(__fn)>;\n+\t  constexpr const _Fn& __fn = constant_wrapper<__cwfn, _Fn>::value;\n \t  if constexpr (is_pointer_v<_Fn> || is_member_pointer_v<_Fn>)\n \t    static_assert(__fn != nullptr);\n \t  if constexpr (is_member_pointer_v<_Fn>)\n@@ -182,8 +190,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t}\n \n       template<typename _Tp>\n-\trequires (!is_same_v<_Tp, function_ref>)\n-\t       && (!is_pointer_v<_Tp>) && (!__is_nontype_v<_Tp>)\n+\trequires (!is_same_v<_Tp, function_ref>) && (!is_pointer_v<_Tp>)\n+\t\t && (!__is_constant_wrapper_v<_Tp>)\n \tfunction_ref&\n \toperator=(_Tp) = delete;\n \ndiff --git a/libstdc++-v3/include/bits/funcwrap.h b/libstdc++-v3/include/bits/funcwrap.h\nindex 6441893d213..b835e075295 100644\n--- a/libstdc++-v3/include/bits/funcwrap.h\n+++ b/libstdc++-v3/include/bits/funcwrap.h\n@@ -573,15 +573,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n     requires is_function_v<_Fn>\n     function_ref(_Fn*) -> function_ref<_Fn>;\n \n-  template<auto __f, class _Fn = remove_pointer_t<decltype(__f)>>\n-    requires is_function_v<_Fn>\n-    function_ref(nontype_t<__f>) -> function_ref<_Fn>;\n+  template<auto __cwfn, typename _Fn>\n+    requires is_function_v<remove_pointer_t<_Fn>>\n+    function_ref(constant_wrapper<__cwfn, _Fn>)\n+      -> function_ref<remove_pointer_t<_Fn>>;\n \n-  template<auto __f, typename _Tp,\n+  template<auto __cwfn, typename _Fn, typename _Tp,\n \t   typename _SignaturePtr =\n-\t     decltype(__polyfunc::__deduce_funcref<decltype(__f), _Tp&>())>\n+\t     decltype(__polyfunc::__deduce_funcref<_Fn, _Tp&>())>\n     requires (!is_void_v<_SignaturePtr>)\n-    function_ref(nontype_t<__f>, _Tp&&)\n+    function_ref(constant_wrapper<__cwfn, _Fn>, _Tp&&)\n       -> function_ref<remove_pointer_t<_SignaturePtr>>;\n \n #endif // __glibcxx_function_ref\ndiff --git a/libstdc++-v3/include/bits/utility.h b/libstdc++-v3/include/bits/utility.h\nindex 970e63e8170..93e9e9f9dba 100644\n--- a/libstdc++-v3/include/bits/utility.h\n+++ b/libstdc++-v3/include/bits/utility.h\n@@ -458,6 +458,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n     { return value; }\n   };\n \n+  template<typename>\n+    constexpr bool __is_constant_wrapper_v = false;\n+\n+  template<auto __cw, typename _Fn>\n+    constexpr bool __is_constant_wrapper_v<constant_wrapper<__cw, _Fn>> = true;\n+\n   template<_CwFixedValue _Tp>\n     constexpr auto cw = constant_wrapper<_Tp>{};\n #endif\n@@ -637,23 +643,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n   inline constexpr sorted_equivalent_t sorted_equivalent{};\n #endif\n \n-#if __glibcxx_function_ref // >= C++26\n-  template<auto>\n-    struct nontype_t\n-    {\n-      explicit nontype_t() = default;\n-    };\n-\n-  template<auto __val>\n-    constexpr nontype_t<__val> nontype{};\n-\n-  template<typename>\n-    inline constexpr bool __is_nontype_v = false;\n-\n-  template<auto __val>\n-    inline constexpr bool __is_nontype_v<nontype_t<__val>> = true;\n-#endif\n-\n _GLIBCXX_END_NAMESPACE_VERSION\n } // namespace\n \ndiff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/std.cc.in\nindex db66677d55b..3ac19871692 100644\n--- a/libstdc++-v3/src/c++23/std.cc.in\n+++ b/libstdc++-v3/src/c++23/std.cc.in\n@@ -3651,10 +3651,6 @@ export namespace std\n   using std::make_integer_sequence;\n   using std::move;\n   using std::move_if_noexcept;\n-#if __cpp_lib_function_ref\n-  using std::nontype_t;\n-  using std::nontype;\n-#endif\n   using std::pair;\n   using std::swap;\n   using std::operator==;\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/assign.cc b/libstdc++-v3/testsuite/20_util/function_ref/assign.cc\nindex 9b02dc49c2a..521a35fc11e 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/assign.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/assign.cc\n@@ -8,8 +8,7 @@\n # error \"Feature-test macro for function_ref has wrong value in <functional>\"\n #endif\n \n-using std::nontype;\n-using std::nontype_t;\n+using std::constant_wrapper;\n using std::function_ref;\n \n using std::is_nothrow_move_assignable_v;\n@@ -55,13 +54,13 @@ static_assert( ! is_assignable_v<function_ref<int(S)>, decltype(&S::x)> );\n static_assert( ! is_assignable_v<function_ref<int(S)>, decltype(&S::f)> );\n \n static_assert( is_nothrow_assignable_v<function_ref<int(S)>,\n-\t\t\t\t       nontype_t<funS>> );\n+\t\t\t\t       constant_wrapper<funS>> );\n static_assert( is_nothrow_assignable_v<function_ref<int(S)>,\n-\t\t\t\t       nontype_t<&funS>> );\n+\t\t\t\t       constant_wrapper<&funS>> );\n static_assert( is_nothrow_assignable_v<function_ref<int(S)>,\n-\t\t\t\t       nontype_t<&S::x>> );\n+\t\t\t\t       constant_wrapper<&S::x>> );\n static_assert( is_nothrow_assignable_v<function_ref<int(S)>,\n-\t\t\t\t       nontype_t<&S::f>> );\n+\t\t\t\t       constant_wrapper<&S::f>> );\n struct Q\n {\n   void operator()() const;\n@@ -75,22 +74,22 @@ static_assert( ! is_assignable_v<function_ref<void() const>, Q&> );\n static_assert( ! is_assignable_v<function_ref<void() const>, const Q&> );\n \n static_assert( is_nothrow_assignable_v<function_ref<void()>,\n-\t\t\t\t       nontype_t<Q{}>> );\n+\t\t\t\t       constant_wrapper<Q{}>> );\n static_assert( is_nothrow_assignable_v<function_ref<void() const>,\n-\t\t\t\t       nontype_t<Q{}>> );\n+\t\t\t\t       constant_wrapper<Q{}>> );\n \n constexpr bool\n test_constexpr()\n {\n-  function_ref<void(S)> fp(nontype<funS>);\n-  fp = nontype<funS>;\n-  fp = nontype<&funS>;\n-  fp = nontype<&S::x>;\n-  fp = nontype<&S::f>;\n+  function_ref<void(S)> fp(std::cw<funS>);\n+  fp = std::cw<funS>;\n+  fp = std::cw<&funS>;\n+  fp = std::cw<&S::x>;\n+  fp = std::cw<&S::f>;\n \n   constexpr Q cq;\n   function_ref<void() const> fq(cq);\n-  fq = nontype<cq>;\n+  fq = std::cw<cq>;\n   return true;\n }\n static_assert( test_constexpr() );\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/call.cc b/libstdc++-v3/testsuite/20_util/function_ref/call.cc\nindex 49c6030b221..386c8de790a 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/call.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/call.cc\n@@ -4,7 +4,6 @@\n #include <utility>\n #include <testsuite_hooks.h>\n \n-using std::nontype;\n using std::function_ref;\n \n using std::is_same_v;\n@@ -43,7 +42,7 @@ test01()\n   VERIFY( f0() == 0 );\n   VERIFY( std::move(f0)() == 0 );\n \n-  function_ref<int()> f1{nontype<F{}>};\n+  function_ref<int()> f1{std::cw<F{}>};\n   VERIFY( f1() == 1 );\n   VERIFY( std::move(f1)() == 1 );\n \n@@ -53,7 +52,7 @@ test01()\n   VERIFY( std::move(f2)() == 1 );\n   VERIFY( std::move(std::as_const(f2))() == 1 );\n \n-  function_ref<int() const> f3{nontype<F{}>};\n+  function_ref<int() const> f3{std::cw<F{}>};\n   VERIFY( f3() == 1 );\n   VERIFY( std::as_const(f3)() == 1 );\n   VERIFY( std::move(f3)() == 1 );\n@@ -71,11 +70,11 @@ test02()\n   };\n   F::Arg arg;\n \n-  function_ref<int()> f0{std::nontype<F{}>, arg};\n+  function_ref<int()> f0{std::cw<F{}>, arg};\n   VERIFY( f0() == 0 );\n   VERIFY( std::move(f0)() == 0 );\n \n-  function_ref<int() const> f1{std::nontype<F{}>, arg};\n+  function_ref<int() const> f1{std::cw<F{}>, arg};\n   VERIFY( f1() == 1 );\n   VERIFY( std::as_const(f1)() == 1 );\n }\n@@ -91,11 +90,11 @@ test03()\n   };\n   F::Arg arg;\n \n-  function_ref<int()> f0{std::nontype<F{}>, &arg};\n+  function_ref<int()> f0{std::cw<F{}>, &arg};\n   VERIFY( f0() == 0 );\n   VERIFY( std::move(f0)() == 0 );\n \n-  function_ref<int() const> f1{std::nontype<F{}>, &arg};\n+  function_ref<int() const> f1{std::cw<F{}>, &arg};\n   VERIFY( f1() == 1 );\n   VERIFY( std::as_const(f1)() == 1 );\n }\n@@ -108,7 +107,7 @@ test04()\n   VERIFY( f0() == 0 );\n   VERIFY( std::move(f0)() == 0 );\n \n-  function_ref<int()> f1{nontype<fp>};\n+  function_ref<int()> f1{std::cw<fp>};\n   VERIFY( f1() == 0 );\n   VERIFY( std::move(f1)() == 0 );\n \n@@ -116,7 +115,7 @@ test04()\n   VERIFY( f2() == 0 );\n   VERIFY( std::move(f2)() == 0 );\n \n-  const function_ref<int() const> f3{nontype<fp>};\n+  const function_ref<int() const> f3{std::cw<fp>};\n   VERIFY( f2() == 0 );\n   VERIFY( std::move(f2)() == 0 );\n }\n@@ -130,14 +129,14 @@ int callback_ref(ftype& f, int x) { return f(x); }\n void\n test05()\n {\n-  function_ref<int(int)> r1(nontype<&callback_ptr>, &twice);\n+  function_ref<int(int)> r1(std::cw<&callback_ptr>, &twice);\n   VERIFY( r1(2) == 4 );\n-  function_ref<int(int)> r2(nontype<&callback_ptr>, cube);\n+  function_ref<int(int)> r2(std::cw<&callback_ptr>, cube);\n   VERIFY( r2(2) == 8 );\n \n-  function_ref<int(int)> r3(nontype<&callback_ref>, twice);\n+  function_ref<int(int)> r3(std::cw<&callback_ref>, twice);\n   VERIFY( r3(3) == 6 );\n-  function_ref<int(int)> r4(nontype<&callback_ref>, cube);\n+  function_ref<int(int)> r4(std::cw<&callback_ref>, cube);\n   VERIFY( r4(3) == 27 );\n }\n \n@@ -174,37 +173,37 @@ test06()\n   std::function_ref<const int&(int, int) const> e8(std::as_const(csr));\n   VERIFY( &e8(0, 0) == &s.v );\n \n-  std::function_ref<int&()> f1(std::nontype<&S::v>, sr);\n+  std::function_ref<int&()> f1(std::cw<&S::v>, sr);\n   VERIFY( &f1() == &s.v );\n-  std::function_ref<const int&()> f2(std::nontype<&S::v>, sr);\n+  std::function_ref<const int&()> f2(std::cw<&S::v>, sr);\n   VERIFY( &f2() == &s.v );\n-  std::function_ref<int&()> f3(std::nontype<&S::m>, sr);\n+  std::function_ref<int&()> f3(std::cw<&S::m>, sr);\n   VERIFY( &f3() == &s.v );\n-  std::function_ref<const int&()> f4(std::nontype<&S::c>, sr);\n+  std::function_ref<const int&()> f4(std::cw<&S::c>, sr);\n   VERIFY( &f4() == &s.v );\n \n-  std::function_ref<const int&()> f5(std::nontype<&S::v>, csr);\n+  std::function_ref<const int&()> f5(std::cw<&S::v>, csr);\n   VERIFY( &f5() == &s.v );\n-  std::function_ref<const int&()> f6(std::nontype<&S::c>, sr);\n+  std::function_ref<const int&()> f6(std::cw<&S::c>, sr);\n   VERIFY( &f6() == &s.v );\n   static_assert( !std::is_constructible_v<\n     std::function_ref<int&()>,\n-    std::nontype_t<&S::c>, std::reference_wrapper<S>&>\n+    std::constant_wrapper<&S::c>, std::reference_wrapper<S>&>\n    );\n \n-  std::function_ref<int&()> f7(std::nontype<&S::v>, std::as_const(sr));\n+  std::function_ref<int&()> f7(std::cw<&S::v>, std::as_const(sr));\n   VERIFY( &f7() == &s.v );\n-  std::function_ref<const int&()> f8(std::nontype<&S::m>, std::as_const(sr));\n+  std::function_ref<const int&()> f8(std::cw<&S::m>, std::as_const(sr));\n   VERIFY( &f8() == &s.v );\n \n   // No rvalue reference_wrapper support\n   static_assert( !std::is_constructible_v<\n     std::function_ref<int&()>,\n-    std::nontype_t<&S::v>, std::reference_wrapper<S>>\n+    std::constant_wrapper<&S::v>, std::reference_wrapper<S>>\n   );\n   static_assert( !std::is_constructible_v<\n     std::function_ref<int&()>,\n-    std::nontype_t<&S::v>, std::reference_wrapper<const S>>\n+    std::constant_wrapper<&S::v>, std::reference_wrapper<const S>>\n   );\n \n   // reference to reference_wrapper are bound, so mutation are visible\n@@ -232,9 +231,9 @@ test06()\n   { return &x; };\n \n   // identity of reference_wrapper is preserved\n-  std::function_ref<const std::reference_wrapper<S>*()> g1(std::nontype<id>, sr);\n+  std::function_ref<const std::reference_wrapper<S>*()> g1(std::cw<id>, sr);\n   VERIFY( g1() == &sr );\n-  std::function_ref<const std::reference_wrapper<const S>*()> g2(std::nontype<id>, csr);\n+  std::function_ref<const std::reference_wrapper<const S>*()> g2(std::cw<id>, csr);\n   VERIFY( g2() == &csr );\n }\n \ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/cons.cc b/libstdc++-v3/testsuite/20_util/function_ref/cons.cc\nindex a91f5ba3dab..78aebd38a07 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/cons.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/cons.cc\n@@ -9,8 +9,7 @@\n # error \"Feature-test macro for function_ref has wrong value in <functional>\"\n #endif\n \n-using std::nontype;\n-using std::nontype_t;\n+using std::constant_wrapper;\n using std::function_ref;\n \n using std::is_default_constructible_v;\n@@ -60,31 +59,31 @@ static_assert( ! is_constructible_v<function_ref<int(S)>,\n \t\t\t\t    decltype(&S::f)> );\n \n static_assert( is_nothrow_constructible_v<function_ref<int(S)>,\n-\t\t\t\t\t  nontype_t<funS>> );\n+\t\t\t\t\t  constant_wrapper<funS>> );\n static_assert( is_nothrow_constructible_v<function_ref<int(S)>,\n-\t\t\t\t\t  nontype_t<&funS>> );\n+\t\t\t\t\t  constant_wrapper<&funS>> );\n static_assert( is_nothrow_constructible_v<function_ref<int(S)>,\n-\t\t\t\t\t  nontype_t<&S::x>> );\n+\t\t\t\t\t  constant_wrapper<&S::x>> );\n static_assert( is_nothrow_constructible_v<function_ref<int(S)>,\n-\t\t\t\t\t  nontype_t<&S::f>> );\n+\t\t\t\t\t  constant_wrapper<&S::f>> );\n \n static_assert( is_nothrow_constructible_v<function_ref<int()>,\n-\t\t\t\t\t  nontype_t<funS>, S&> );\n+\t\t\t\t\t  constant_wrapper<funS>, S&> );\n static_assert( is_nothrow_constructible_v<function_ref<int()>,\n-\t\t\t\t\t  nontype_t<&funS>, S&> );\n+\t\t\t\t\t  constant_wrapper<&funS>, S&> );\n static_assert( is_nothrow_constructible_v<function_ref<int()>,\n-\t\t\t\t\t  nontype_t<&S::x>, S&> );\n+\t\t\t\t\t  constant_wrapper<&S::x>, S&> );\n static_assert( is_nothrow_constructible_v<function_ref<int()>,\n-\t\t\t\t\t  nontype_t<&S::f>, S&> );\n+\t\t\t\t\t  constant_wrapper<&S::f>, S&> );\n \n static_assert( ! is_constructible_v<function_ref<int()>,\n-\t\t\t\t    nontype_t<funS>, S*> );\n+\t\t\t\t    constant_wrapper<funS>, S*> );\n static_assert( ! is_constructible_v<function_ref<int()>,\n-\t\t\t\t    nontype_t<&funS>, S*> );\n+\t\t\t\t    constant_wrapper<&funS>, S*> );\n static_assert( is_nothrow_constructible_v<function_ref<int()>,\n-\t\t\t\t\t  nontype_t<&S::x>, S*> );\n+\t\t\t\t\t  constant_wrapper<&S::x>, S*> );\n static_assert( is_nothrow_constructible_v<function_ref<int()>,\n-\t\t\t\t\t  nontype_t<&S::f>, S*> );\n+\t\t\t\t\t  constant_wrapper<&S::f>, S*> );\n \n struct M\n {\n@@ -98,9 +97,9 @@ static_assert( ! is_constructible_v<function_ref<void()>, const M&> );\n static_assert( ! is_constructible_v<function_ref<void() const>, M> );\n static_assert( ! is_constructible_v<function_ref<void() const>, const M&> );\n static_assert( ! is_constructible_v<function_ref<void()>,\n-\t\t\t\t    nontype_t<M{}>> );\n+\t\t\t\t    constant_wrapper<M{}>> );\n static_assert( ! is_constructible_v<function_ref<void() const>,\n-\t\t\t\t    nontype_t<M{}>> );\n+\t\t\t\t    constant_wrapper<M{}>> );\n struct Q\n {\n   void operator()(int) const;\n@@ -115,22 +114,22 @@ static_assert( is_nothrow_constructible_v<function_ref<void(int) const>, Q&> );\n static_assert( is_nothrow_constructible_v<function_ref<void(int) const>, const Q&> );\n \n static_assert( is_nothrow_constructible_v<function_ref<void(int)>,\n-\t\t\t\t\t  nontype_t<Q{}>> );\n+\t\t\t\t\t  constant_wrapper<Q{}>> );\n static_assert( is_nothrow_constructible_v<function_ref<void(int) const>,\n-\t\t\t\t\t  nontype_t<Q{}>> );\n+\t\t\t\t\t  constant_wrapper<Q{}>> );\n static_assert( is_nothrow_constructible_v<function_ref<void()>,\n-\t\t\t\t\t  nontype_t<Q{}>, int&> );\n+\t\t\t\t\t  constant_wrapper<Q{}>, int&> );\n static_assert( is_nothrow_constructible_v<function_ref<void() const>,\n-\t\t\t\t\t  nontype_t<Q{}>, int&> );\n+\t\t\t\t\t  constant_wrapper<Q{}>, int&> );\n static_assert( ! is_constructible_v<function_ref<void()>,\n-\t\t\t\t    nontype_t<Q{}>, int> );\n+\t\t\t\t    constant_wrapper<Q{}>, int> );\n static_assert( ! is_constructible_v<function_ref<void() const>,\n-\t\t\t\t    nontype_t<Q{}>, int> );\n+\t\t\t\t    constant_wrapper<Q{}>, int> );\n \n static_assert( is_nothrow_constructible_v<function_ref<void()>,\n-\t\t\t\t\t  nontype_t<Q{}>, int*> );\n+\t\t\t\t\t  constant_wrapper<Q{}>, int*> );\n static_assert( ! is_constructible_v<function_ref<void() const>,\n-\t\t\t\t    nontype_t<Q{}>, int*> );\n+\t\t\t\t    constant_wrapper<Q{}>, int*> );\n \n struct L\n {\n@@ -143,9 +142,9 @@ static_assert( ! is_constructible_v<function_ref<void()>, const L&> );\n static_assert( ! is_constructible_v<function_ref<void() const>, L> );\n static_assert( ! is_constructible_v<function_ref<void() const>, const L&> );\n static_assert( ! is_constructible_v<function_ref<void()>,\n-\t\t\t\t    nontype_t<L{}>> );\n+\t\t\t\t    constant_wrapper<L{}>> );\n static_assert( ! is_constructible_v<function_ref<void() const>,\n-\t\t\t\t    nontype_t<L{}>> );\n+\t\t\t\t    constant_wrapper<L{}>> );\n \n struct R\n {\n@@ -159,24 +158,24 @@ static_assert( ! is_constructible_v<function_ref<void(float) const>, R&> );\n static_assert( ! is_constructible_v<function_ref<void(float) const>, const R&> );\n \n static_assert( ! is_constructible_v<function_ref<void(float)>,\n-\t\t\t\t\t\t nontype_t<R{}>> );\n+\t\t\t\t    constant_wrapper<R{}>> );\n static_assert( ! is_constructible_v<function_ref<void(float) const>,\n-\t\t\t\t\t\t nontype_t<R{}>> );\n+\t\t\t\t    constant_wrapper<R{}>> );\n \n constexpr bool\n test_constexpr()\n {\n-  function_ref<void(S)> fp1(nontype<funS>);\n-  function_ref<void(S)> fp3(nontype<&funS>);\n-  function_ref<void(S)> fp4(nontype<&S::x>);\n-  function_ref<void(S)> fp5(nontype<&S::f>);\n+  function_ref<void(S)> fp1(std::cw<funS>);\n+  function_ref<void(S)> fp3(std::cw<&funS>);\n+  function_ref<void(S)> fp4(std::cw<&S::x>);\n+  function_ref<void(S)> fp5(std::cw<&S::f>);\n \n   S s;\n-  function_ref<void()> fp6(nontype<&funS>, s);\n-  function_ref<void()> fp7(nontype<&S::x>, s);\n-  function_ref<void()> fp8(nontype<&S::x>, &s);\n-  function_ref<void()> fp9(nontype<&S::f>, s);\n-  function_ref<void()> fp10(nontype<&S::f>, &s);\n+  function_ref<void()> fp6(std::cw<&funS>, s);\n+  function_ref<void()> fp7(std::cw<&S::x>, s);\n+  function_ref<void()> fp8(std::cw<&S::x>, &s);\n+  function_ref<void()> fp9(std::cw<&S::f>, s);\n+  function_ref<void()> fp10(std::cw<&S::f>, &s);\n \n   M m;\n   function_ref<void()> fm1(m);\n@@ -190,13 +189,13 @@ test_constexpr()\n \n   function_ref<void(int)> fcq1(cq);\n   function_ref<void(int) const> f(cq);\n-  function_ref<void(int)> fcq3(nontype<cq>);\n-  function_ref<void(int) const> fcq4(nontype<cq>);\n+  function_ref<void(int)> fcq3(std::cw<cq>);\n+  function_ref<void(int) const> fcq4(std::cw<cq>);\n \n   int i = 0;\n-  function_ref<void()> fcq5(nontype<cq>, i);\n-  function_ref<void() const> fcq6(nontype<cq>, i);\n-  function_ref<void()> fcq7(nontype<cq>, &i);\n+  function_ref<void()> fcq5(std::cw<cq>, i);\n+  function_ref<void() const> fcq6(std::cw<cq>, i);\n+  function_ref<void()> fcq7(std::cw<cq>, &i);\n \n   L l;\n   function_ref<void()> fl1(l);\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/cons_neg.cc b/libstdc++-v3/testsuite/20_util/function_ref/cons_neg.cc\nindex 050090df370..a426ac64cd5 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/cons_neg.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/cons_neg.cc\n@@ -2,7 +2,6 @@\n \n #include <functional>\n \n-using std::nontype;\n using std::function_ref;\n \n struct S\n@@ -16,15 +15,15 @@ constexpr int(*fp)(S) = nullptr;\n constexpr int S::*mdp = nullptr;\n constexpr int (S::*mfp)() = nullptr;\n \n-function_ref<int(S)> fd1(nontype<fp>);  // { dg-error \"from here\" }\n-function_ref<int(S)> fd2(nontype<mdp>); // { dg-error \"from here\" }\n-function_ref<int(S)> fd3(nontype<mfp>); // { dg-error \"from here\" }\n+function_ref<int(S)> fd1(std::cw<fp>);  // { dg-error \"from here\" }\n+function_ref<int(S)> fd2(std::cw<mdp>); // { dg-error \"from here\" }\n+function_ref<int(S)> fd3(std::cw<mfp>); // { dg-error \"from here\" }\n \n-function_ref<int()> br4(nontype<fp>, s);  // { dg-error \"from here\" }\n-function_ref<int()> br5(nontype<mdp>, s); // { dg-error \"from here\" }\n-function_ref<int()> br6(nontype<mfp>, s); // { dg-error \"from here\" }\n+function_ref<int()> br4(std::cw<fp>, s);  // { dg-error \"from here\" }\n+function_ref<int()> br5(std::cw<mdp>, s); // { dg-error \"from here\" }\n+function_ref<int()> br6(std::cw<mfp>, s); // { dg-error \"from here\" }\n \n-function_ref<int()> bp7(nontype<mdp>, &s); // { dg-error \"from here\" }\n-function_ref<int()> bp8(nontype<mfp>, &s); // { dg-error \"from here\" }\n+function_ref<int()> bp7(std::cw<mdp>, &s); // { dg-error \"from here\" }\n+function_ref<int()> bp8(std::cw<mfp>, &s); // { dg-error \"from here\" }\n \n // { dg-prune-output \"static assertion failed\" }\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/cw_cons_neg.cc b/libstdc++-v3/testsuite/20_util/function_ref/cw_cons_neg.cc\nnew file mode 100644\nindex 00000000000..a295bc2ce31\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/cw_cons_neg.cc\n@@ -0,0 +1,35 @@\n+// { dg-do compile { target c++26 } }\n+\n+#include <functional>\n+\n+using std::function_ref;\n+using std::constant_wrapper;\n+\n+struct S\n+{\n+  int operator()() const { return 1; }\n+\n+  // Non-constant, so cw<S{}>(cw<1>) call never unwrapps\n+  int operator()(int) const { return 1; }\n+  template<auto __cw>\n+    int operator()(constant_wrapper<__cw, int>) const { return 1; }\n+\n+  // Constant, cw<S{}>(cw<1>, cw<2>) calls int overload\n+  // while S{}(cw<1>, cw<1>) calls constant_wrapper overload\n+  constexpr int operator()(int, int) const { return 1; }\n+  template<auto __cw1, auto __cw2>\n+    constexpr int operator()(constant_wrapper<__cw1, int>,\n+\t\t\t     constant_wrapper<__cw2, int>)\n+    { return 1; }\n+};\n+\n+function_ref<int()> f0a(S{});\n+\n+function_ref<int(int)> f1a(S{});\n+function_ref<int(constant_wrapper<2>)> f1b(std::cw<S{}>);\n+\n+function_ref<int(int, int)> f2a(std::cw<S{}>); // OK, runtime\n+function_ref<int(constant_wrapper<1>, int)> f2b(std::cw<S{}>); // OK, still runtime\n+function_ref<int(constant_wrapper<2>, constant_wrapper<3>)> f2c(std::cw<S{}>); // { dg-error \"from here\" }\n+\n+// { dg-prune-output \"static assertion failed\" }\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/dangling.cc b/libstdc++-v3/testsuite/20_util/function_ref/dangling.cc\nindex 3cc782524f6..4ef5d067555 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/dangling.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/dangling.cc\n@@ -46,7 +46,7 @@ struct NonStatic {\n   { return x + y + v; }\n };\n \n-constexpr auto vNonType = create(std::nontype<NonStatic{3}>);\n+constexpr auto vNonType = create(std::cw<NonStatic{3}>);\n \n struct StaticWins {\n   static int\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/deduction.cc b/libstdc++-v3/testsuite/20_util/function_ref/deduction.cc\nindex b034c7af072..63c3f6ea7e3 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/deduction.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/deduction.cc\n@@ -4,15 +4,13 @@\n #include <type_traits>\n \n using std::is_same_v;\n-using std::nontype;\n-using std::nontype_t;\n using std::function_ref;\n \n int i = 0;\n \n template<auto f, class... Args>\n   concept deductible = requires (Args&... args) \n-  { std::function_ref(std::nontype<f>, args...); };\n+  { std::function_ref(std::cw<f>, args...); };\n \n static_assert( !deductible<1> );\n static_assert( !deductible<1, int> );\n@@ -24,9 +22,9 @@ static_assert( is_same_v<decltype(function_ref(f0)),\n \t\t\t function_ref<void()>> );\n static_assert( is_same_v<decltype(function_ref(f0n)),\n \t\t\t function_ref<void() noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f0>)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f0>)),\n \t\t\t function_ref<void()>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f0n>)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f0n>)),\n \t\t\t function_ref<void() noexcept>> );\n static_assert( !deductible<f0, char*> );\n static_assert( !deductible<f0n, char*> );\n@@ -38,13 +36,13 @@ static_assert( is_same_v<decltype(function_ref(f1)),\n \t\t\t function_ref<void(int)>> );\n static_assert( is_same_v<decltype(function_ref(f1n)),\n \t\t\t function_ref<void(int) noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f1>)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f1>)),\n \t\t\t function_ref<void(int)>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f1n>)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f1n>)),\n \t\t\t function_ref<void(int) noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f1>, i)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f1>, i)),\n \t\t\t function_ref<void()>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f1n>, i)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f1n>, i)),\n \t\t\t function_ref<void() noexcept>> );\n static_assert( !deductible<f1, char*> );\n static_assert( !deductible<f1n, char*> );\n@@ -56,13 +54,13 @@ static_assert( is_same_v<decltype(function_ref(f2)),\n \t\t\t function_ref<void(int*, int)>> );\n static_assert( is_same_v<decltype(function_ref(f2n)),\n \t\t\t function_ref<void(int*, int) noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f2>)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f2>)),\n \t\t\t function_ref<void(int*, int)>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f2n>)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f2n>)),\n \t\t\t function_ref<void(int*, int) noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f2>, &i)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f2>, &i)),\n \t\t\t function_ref<void(int)>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<f2n>, &i)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<f2n>, &i)),\n \t\t\t function_ref<void(int) noexcept>> );\n static_assert( !deductible<f2, char*> );\n static_assert( !deductible<f2n, char*> );\n@@ -88,40 +86,40 @@ struct S\n S s{};\n const S cs{};\n \n-static_assert( is_same_v<decltype(function_ref(nontype<&S::mem>, s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::mem>, s)),\n \t\t\t function_ref<int&() noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::mem>, cs)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::mem>, cs)),\n \t\t\t function_ref<const int&() noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::mem>, &s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::mem>, &s)),\n \t\t\t function_ref<int&() noexcept>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::mem>, &cs)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::mem>, &cs)),\n \t\t\t function_ref<const int&() noexcept>> );\n static_assert( !deductible<&S::mem, int> );\n \n-static_assert( is_same_v<decltype(function_ref(nontype<&S::f>, s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::f>, s)),\n \t\t\t function_ref<int()>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fn>, &s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fn>, &s)),\n \t\t\t function_ref<int() noexcept>> );\n static_assert( !deductible<&S::f, char*> );\n static_assert( !deductible<&S::fn, char*> );\n static_assert( !deductible<&S::f, const S> );\n static_assert( !deductible<&S::fn, const S> );\n \n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fc>, &s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fc>, &s)),\n \t\t\t function_ref<int(int)>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fcn>, s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fcn>, s)),\n \t\t\t function_ref<int(int) noexcept>> );\n static_assert( !deductible<&S::fc, char*> );\n static_assert( !deductible<&S::fcn, char*> );\n \n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fl>, &s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fl>, &s)),\n \t\t\t function_ref<int(int)>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fln>, s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fln>, s)),\n \t\t\t function_ref<int(int) noexcept>> );\n \n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fcl>, s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fcl>, s)),\n \t\t\t function_ref<int(float)>> );\n-static_assert( is_same_v<decltype(function_ref(nontype<&S::fcln>, &s)),\n+static_assert( is_same_v<decltype(function_ref(std::cw<&S::fcln>, &s)),\n \t\t\t function_ref<int(float) noexcept>> );\n \n static_assert( !deductible<&S::fr, char*> );\ndiff --git a/libstdc++-v3/testsuite/20_util/function_ref/mutation.cc b/libstdc++-v3/testsuite/20_util/function_ref/mutation.cc\nindex 32c6931e9a8..d55f4facbda 100644\n--- a/libstdc++-v3/testsuite/20_util/function_ref/mutation.cc\n+++ b/libstdc++-v3/testsuite/20_util/function_ref/mutation.cc\n@@ -3,7 +3,6 @@\n #include <functional>\n #include <testsuite_hooks.h>\n \n-using std::nontype;\n using std::function_ref;\n \n void\n@@ -55,8 +54,8 @@ test02()\n   };\n   S s{10};\n \n-  function_ref<int()> r1(nontype<&S::x>, s);\n-  function_ref<long()> r2(nontype<&S::x>, &s);\n+  function_ref<int()> r1(std::cw<&S::x>, s);\n+  function_ref<long()> r2(std::cw<&S::x>, &s);\n \n   VERIFY( r1() == 10 );\n   VERIFY( r2() == 10 );\n@@ -66,8 +65,8 @@ test02()\n   VERIFY( r1() == 20 );\n   VERIFY( r2() == 20 );\n \n-  r1 = function_ref<int()>(nontype<&S::f>, &s);\n-  r2 = function_ref<long()>(nontype<&S::f>, s);\n+  r1 = function_ref<int()>(std::cw<&S::f>, &s);\n+  r2 = function_ref<long()>(std::cw<&S::f>, s);\n \n   VERIFY( r1() == 20 );\n   VERIFY( r2() == 20 );\n","prefixes":[]}