From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9970738582AC; Thu, 10 Nov 2022 01:04:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9970738582AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668042261; bh=Q9+LS3tfWL5/W+0u68KmGxggfY1i+nHFtKuBh2Ldxdw=; h=From:To:Subject:Date:From; b=pcavYp57GXDWkNLsW5/5kaShaq6ng8ylyn08+5bqghCDQ2x3D+8TpgwC3jRCMxB3l 6+C1CHw5rjxaU9zmrRw5W21xjkWiro4nfBdSd3uGDjgXI8NmMBb/sgQ7jhXrji8ES+ Z+Ae7oBMGEmm4iJNGKtCnF+iTJuwz1a8iaTguObs= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107600] New: New __is_destructible built-in Date: Thu, 10 Nov 2022 01:04:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107600 Bug ID: 107600 Summary: New __is_destructible built-in Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Like __is_construcible, __is_convertible, __is_assignable, it would be nice= to have an __is_destructible built-in so we don't need to instantiate all this= for every one of the C++20 concepts that depends on it: // In N3290 is_destructible does not say anything about function // types and abstract types, see LWG 2049. This implementation // describes function types as non-destructible and all complete // object types as destructible, iff the explicit destructor // call expression is wellformed. struct __do_is_destructible_impl { template().~_Tp())> static true_type __test(int); template static false_type __test(...); }; template struct __is_destructible_impl : public __do_is_destructible_impl { typedef decltype(__test<_Tp>(0)) type; }; template, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool =3D __or_, is_scalar<_Tp>>::value> struct __is_destructible_safe; template struct __is_destructible_safe<_Tp, false, false> : public __is_destructible_impl::type>::type { }; template struct __is_destructible_safe<_Tp, true, false> : public false_type { }; template struct __is_destructible_safe<_Tp, false, true> : public true_type { }; /// @endcond /// is_destructible template struct is_destructible : public __is_destructible_safe<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); };=