From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C2C2385DDCA; Tue, 3 Sep 2024 13:45:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C2C2385DDCA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1725371130; bh=8szjfLgq1Xilgd/j6e5rE0DIIbBB7jhmmveficipkyM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L2WDR8sh8m5Uqo4Dz1CcxH/4OO5TP6Gby8ADt5hokm7H82/wESsJLrdlLCbII2wyA 73MbgNpv3IBUZYj3pSdyz9gjceDmVAQLjwd+z93o8/Jmok8Io7QK4FHbynSu2+ySn1 NsyRFhVERr1732PY36BQoa0zZdc9anC3DYgSKBtE= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/116529] Construction of unique_ptr with reference type is rejected because of auto_ptr constructor Date: Tue, 03 Sep 2024 13:45:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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=3D116529 --- Comment #7 from Jonathan Wakely --- That's what this does: --- a/libstdc++-v3/include/bits/unique_ptr.h +++ b/libstdc++-v3/include/bits/unique_ptr.h @@ -379,8 +379,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" /// Converting constructor from @c auto_ptr - template, is_same<_Dp, default_delete<_Tp>= >>> + template, + is_same<_Dp, default_delete<_Tp>>>> unique_ptr(auto_ptr<_Up>&& __u) noexcept; #pragma GCC diagnostic pop #endif This is equivalent, because when D must be default_delete, pointer must = be T*. But the ill-formed type now occurs during substitution.=