From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB329385782F; Sun, 25 Oct 2020 19:21:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB329385782F From: "dimitri.gorokhovik at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97572] New: [c++ 20] Constraining is broken Date: Sun, 25 Oct 2020 19:21:49 +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: dimitri.gorokhovik at free dot fr 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: Sun, 25 Oct 2020 19:21:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97572 Bug ID: 97572 Summary: [c++ 20] Constraining is broken Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dimitri.gorokhovik at free dot fr Target Milestone: --- The code: constexpr bool any (bool) { return true; }; template concept Any =3D requires (T t) { requires any (t); }; constexpr static int f (Any auto) { return 42; }; constexpr auto q =3D f (false); when compiled as: g++ -std=3Dc++20 -o bug-9.o -c bug-9.cpp produces: bug-9.cpp: In substitution of =E2=80=98template requires An= y constexpr int f(auto:1) [with auto:1 =3D bool]=E2=80=99: bug-9.cpp:5:28: required from here bug-9.cpp:3:63: error: =E2=80=98t=E2=80=99 is not a constant expression 3 | template concept Any =3D requires (T t) { requires any= (t); }; | ~~~~~~~~~^~~~~= ~~ bug-9.cpp:5:28: error: no matching function for call to =E2=80=98f(bool)=E2= =80=99 5 | constexpr auto q =3D f (false); | ^ bug-9.cpp:4:22: note: candidate: =E2=80=98template requires = Any constexpr int f(auto:1)=E2=80=99 4 | constexpr static int f (Any auto) { return 42; }; | ^ bug-9.cpp:4:22: note: substitution of deduced template arguments resulted= in errors seen above GCC version: g++ (GCC) 11.0.0 20201025 (experimental)=