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.
it now. */
push_deferring_access_checks (dk_no_deferred);
+ auto gr = make_temp_override (parser->greater_than_is_operator_p, true);
+
if (!consteval_block_p)
{
cp_parser_lambda_introducer (parser, lambda_expr);
--- /dev/null
+// PR c++/107953
+// { dg-do compile { target c++20 } }
+
+template<auto F>
+struct Foo {};
+
+Foo<[](){ return 1 >= 0; }> foo1{};
+
+Foo<[](){ return (1 > 0); }> foo2{};
+
+Foo<[](){ return 1 > 0; }> foo3{};
+
+Foo<[g = 1 > 0]{ return g; }> foo4{};