From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1401D3858018; Thu, 10 Jun 2021 01:24:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1401D3858018 From: "barry.revzin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101006] New: Request diagnostic for likely concept syntax errors Date: Thu, 10 Jun 2021 01:23:59 +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: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: barry.revzin at gmail 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: Thu, 10 Jun 2021 01:24:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101006 Bug ID: 101006 Summary: Request diagnostic for likely concept syntax errors Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following: template concept Thing =3D true; template concept MemberThing =3D requires (T t) { t.member() -> Thing; // #1 !requires { t.member(); }; // #2 }; These are likely intended to be (obviously not at the same time, this is ju= st an example): template concept MemberThing =3D requires (T t) { { t.member() } -> Thing; requires !requires { t.member(); }; }; But #1 is very likely to be a bug, and #2 is completely pointless as a requirement since it's tautologically true. It would be nice if gcc could produce warnings in such cases. #2 is a similar case to the P2092 fixup of: template concept MemberThing =3D requires (T t) { requires { t.member(); }; }; which is now ill-formed. However, gcc's diagnostic here could be more helpf= ul too (perhaps including a fixup for an extra requires?) :6:14: error: expected primary-expression before '{' token 6 | requires { t.member(); }; | ^ #1 might be harder to warn about since that could *theoretically* be intend= ed, but if unqualified lookup for Thing actually finds a concept, seems like a = good bet for a diagnostic maybe?=