From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D9B543858C5F; Mon, 1 May 2023 16:32:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9B543858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682958759; bh=bX6Y/omApgLZ9YRRefzzCdZJBdRCUP5UJK8gKLcO1ho=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bV12ld6N5axR1KqP5oBcMli5kd1KCzAS92Lt8ylhgYvEmlEk8uVDMPxjPkBM5vaaC PgB+7mOddvwFGEChT0nUA6xvGXJlYvqULhzvEJe/7IWCZFuJzHARP3pXA5UYed5g29 Eybu7sywrNv6Sh967kb04bzMIvGpAwM/wuXPd+OY= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109680] [13/14 Regression] is_convertible incorrectly true Date: Mon, 01 May 2023 16:32:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 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=3D109680 --- Comment #4 from Jakub Jelinek --- template U __declval (int); template T __declval (long); template auto declval () noexcept -> decltype (__declval (0)); using To =3D int () const; using From =3D int (*) (); To foo () { return declval (); } >From bar () { return declval (); } static_assert (!__is_convertible (To, From), ""); static_assert (!__is_convertible (From, To), ""); should show that both assertions should succeed. Dunno if in this case the reason why it isn't convertible is simply the fact that functions can't be declared to return function/method/array types or some other reason as well= .=