public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99850] [P1102R2] reject valid lambda syntax in C++23 Date: Fri, 16 Apr 2021 07:35:15 +0000 [thread overview] Message-ID: <bug-99850-4-41SyQT3asu@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-99850-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99850 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:784de5292c34e287c848b382b431599b818ea76e commit r11-8210-g784de5292c34e287c848b382b431599b818ea76e Author: Jakub Jelinek <jakub@redhat.com> Date: Fri Apr 16 09:34:26 2021 +0200 c++: Fix up C++23 [] <...> requires primary -> type {} parsing [PR99850] The requires clause parsing has code to suggest users wrapping non-primary expressions in (), so if it e.g. parses a primary expression and sees it is followed by ++, --, ., ( or -> among other things it will try to reparse it as assignment expression or what and if that works suggests wrapping it inside of parens. When it is requires-clause that is after <typename T> etc. it already has an exception from that as ( can occur in valid C++20 expression there - starting the parameters of the lambda. In C++23 another case can occur, as the parameters with the ()s can be omitted, requires C can be followed immediately by -> which starts a trailing return type. Even in that case, we don't want to parse that as C->... 2021-04-16 Jakub Jelinek <jakub@redhat.com> PR c++/99850 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>: If lambda_p, return pce_ok instead of pce_maybe_postfix. * g++.dg/cpp23/lambda-specifiers2.C: New test.
next prev parent reply other threads:[~2021-04-16 7:35 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-31 16:39 [Bug c++/99850] New: " hewillk at gmail dot com 2021-03-31 16:50 ` [Bug c++/99850] " mpolacek at gcc dot gnu.org 2021-03-31 18:01 ` mpolacek at gcc dot gnu.org 2021-03-31 19:43 ` jakub at gcc dot gnu.org 2021-03-31 19:54 ` jakub at gcc dot gnu.org 2021-04-01 6:58 ` hewillk at gmail dot com 2021-04-14 13:03 ` jakub at gcc dot gnu.org 2021-04-16 7:35 ` cvs-commit at gcc dot gnu.org [this message] 2021-04-16 7:36 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-99850-4-41SyQT3asu@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).