From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 45E473857835; Sun, 25 Oct 2020 19:27:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45E473857835 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95132] Concept checked after auto return type deduction Date: Sun, 25 Oct 2020 19:27:19 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to target_milestone 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 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: Sun, 25 Oct 2020 19:27:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95132 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |ASSIGNED Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot g= nu.org Target Milestone|--- |10.3 --- Comment #3 from Patrick Palka --- (In reply to Patrick Palka from comment #2) > (In reply to Francesco Biscani from comment #0) > > This is problematic because it means that another concept that would ch= eck > > whether or not bar() can be called with a specific argument type would = fail > > with a hard compile time error, instead of marking the concept as not > > satisfied. >=20 > Would you have a concrete testcase for this behavior? Ah, here's one: $ cat testcase.C template struct A { static auto f() requires false { return T::fail; } }; template constexpr int v =3D requires { A::f(); }; static_assert(!v); $ g++ -std=3Dc++20 testcase.C testcase.C: In instantiation of =E2=80=98static auto A::f() requires fa= lse [with T =3D int]=E2=80=99: testcase.C: required from =E2=80=98constexpr const int v=E2=80=99 testcase.C: required from here testcase.C: error: =E2=80=98fail=E2=80=99 is not a member of =E2=80=98int= =E2=80=99 2 | static auto f() requires false { return T::fail; } | ^~~~ We wrongly issue a hard error for the reason you pointed out.=