[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2025-08-29 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

Jason Merrill  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Jason Merrill  ---
Fixed for GCC 16.

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2025-08-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

--- Comment #6 from GCC Commits  ---
The trunk branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:00e8690ef0d7ac1ced87ceee309dbfa27909a35c

commit r16-3444-g00e8690ef0d7ac1ced87ceee309dbfa27909a35c
Author: Jason Merrill 
Date:   Sun Aug 24 05:15:01 2025 -0400

c++: > in lambda in template arg [PR107953]

As with PR116928, we need to set greater_than_is_operator_p within the
lambda delimiters.

PR c++/107953

gcc/cp/ChangeLog:

* parser.cc (cp_parser_lambda_expression): Set
greater_than_is_operator_p.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/lambda-targ18.C: New test.

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2025-08-27 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

Jason Merrill  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
   Last reconfirmed||2025-08-27
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2025-05-18 Thread ethanhancock at me dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

Ethan Hancock  changed:

   What|Removed |Added

 CC||ethanhancock at me dot com

--- Comment #5 from Ethan Hancock  ---
template
struct Foo {};

Foo<[](){ return 1 >= 0; }> foo1{};

Foo<[](){ return (1 > 0); }> foo2{};

Foo<[](){ return 1 > 0; }> foo3{};


I ran afoul of this bug, and found this issue.
Can confirm that this bug is still present in GCC 15.1.0.
GCC accepts foo1 and foo2, but rejects foo3.

Clang does accept all 3.

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2022-12-02 Thread majerech.o at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

--- Comment #4 from Ondřej Majerech  ---
It seems that the core of PR 57 is that `A

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2022-12-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

--- Comment #3 from Andrew Pinski  ---
I wonder if this is still an ambiguous part of the C++ grammar and all.

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2022-12-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

--- Comment #2 from Andrew Pinski  ---
Even template defaults has issues:
template  y; }>
int t = 0;

Which is why I Pointed to PR 57.

[Bug c++/107953] Greater-than operator misparsed inside a lambda expression used as a template argument

2022-12-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107953

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=57

--- Comment #1 from Andrew Pinski  ---
I suspect this is the same issue as PR 57 .