From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8766393D033; Sat, 19 Dec 2020 05:58:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8766393D033 From: "ensadc at mailnesia dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98388] New: Throwing move-only parameter results in hard error in SFINAE context Date: Sat, 19 Dec 2020 05:58:52 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ensadc at mailnesia dot com 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2020 05:58:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98388 Bug ID: 98388 Summary: Throwing move-only parameter results in hard error in SFINAE context Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ensadc at mailnesia dot com Target Milestone: --- https://godbolt.org/z/xn8fYz =3D=3D=3D=3D struct moveonly { moveonly() =3D default; moveonly(moveonly&&) =3D default; }; template constexpr auto is_throwable(T t) -> decltype(throw t, true) { return true; } template constexpr bool is_throwable(...) { return false; } constexpr bool b =3D is_throwable(moveonly{}); =3D=3D=3D=3D : In substitution of 'template constexpr decltype ((, true)) is_throwable(T) [with T =3D moveonly]': :13:43: required from here :7:46: error: use of deleted function 'constexpr moveonly::moveonly(const moveonly&)' 7 | constexpr auto is_throwable(T t) -> decltype(throw t, true) { | ^~~~~~~ :1:8: note: 'constexpr moveonly::moveonly(const moveonly&)' is implicitly declared as deleted because 'moveonly' declares a move construct= or or move assignment operator 1 | struct moveonly { | ^~~~~~~~ :7:52: note: in thrown expression 7 | constexpr auto is_throwable(T t) -> decltype(throw t, true) { | ^ =3D=3D=3D=3D I'm not sure what the value of `b` should be, but I believe that it should = not be a hard error. (Clang and MSVC initialize `b` to `true`.)=