From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36F473858C50; Fri, 2 Dec 2022 17:32:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36F473858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670002329; bh=XbvxHkKHzqbWXgIwGWtkS03TztBzCcVlKfwYC7TKW7A=; h=From:To:Subject:Date:From; b=XR6V7Ddg0WfhVjhu/8M6p5f26oYwI5jRFK7SHHDVqL4pJk03WF3ioXMerXQTJR6lQ iVCee6ZJWh+a87xOjLhZNTqulTre6OXJURj2ZQL9Ke+32mchmls02dmwzlMrYmW0mZ D/ATisXU0pZjDsNj+9aEzXwhOamygaNcH5FcpnR0= From: "majerech.o at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107953] New: Greater-than operator misparsed inside a lambda expression used as a template argument Date: Fri, 02 Dec 2022 17:32:08 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: majerech.o 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107953 Bug ID: 107953 Summary: Greater-than operator misparsed inside a lambda expression used as a template argument Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: majerech.o at gmail dot com Target Milestone: --- template void f() { } constexpr auto g =3D f<[] (int x, int y) { return x > y; }>; This produces the following diagnostic: : In lambda function: :5:50: error: expected ';' before '>' token 5 | constexpr auto g =3D f<[] (int x, int y) { return x > y; }>; | ^~ | ; :5:51: error: expected primary-expression before '>' token 5 | constexpr auto g =3D f<[] (int x, int y) { return x > y; }>; | ^ ASM generation compiler returned: 1 : In lambda function: :5:50: error: expected ';' before '>' token 5 | constexpr auto g =3D f<[] (int x, int y) { return x > y; }>; | ^~ | ; :5:51: error: expected primary-expression before '>' token 5 | constexpr auto g =3D f<[] (int x, int y) { return x > y; }>; | ^ Godbolt link to the above: https://godbolt.org/z/KG6d5E6ev Changing the body to return (x > y); makes the error go away as a workaroun= d. So I speculate that the greater-than operator is misparsed as the end of the template argument list.=