public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97839] New: Template lambda incorrectly requiring the optional lambda-declarator
@ 2020-11-15 15:11 gareth@ignition-web.co.uk
  2020-11-17 15:44 ` [Bug c++/97839] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gareth@ignition-web.co.uk @ 2020-11-15 15:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97839

            Bug ID: 97839
           Summary: Template lambda incorrectly requiring the optional
                    lambda-declarator
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gareth@ignition-web.co.uk
  Target Milestone: ---

int main()
{
    []<typename T>{}.operator()<int>();
}

https://godbolt.org/z/eo4ebr

http://eel.is/c++draft/expr.prim.lambda.general#nt:lambda-expression

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97839] Template lambda incorrectly requiring the optional lambda-declarator
  2020-11-15 15:11 [Bug c++/97839] New: Template lambda incorrectly requiring the optional lambda-declarator gareth@ignition-web.co.uk
@ 2020-11-17 15:44 ` mpolacek at gcc dot gnu.org
  2020-11-17 16:01 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-17 15:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97839

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-11-17

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, thanks for reporting it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97839] Template lambda incorrectly requiring the optional lambda-declarator
  2020-11-15 15:11 [Bug c++/97839] New: Template lambda incorrectly requiring the optional lambda-declarator gareth@ignition-web.co.uk
  2020-11-17 15:44 ` [Bug c++/97839] " mpolacek at gcc dot gnu.org
@ 2020-11-17 16:01 ` mpolacek at gcc dot gnu.org
  2020-11-21 20:36 ` cvs-commit at gcc dot gnu.org
  2020-11-21 20:50 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-17 16:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97839

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97839] Template lambda incorrectly requiring the optional lambda-declarator
  2020-11-15 15:11 [Bug c++/97839] New: Template lambda incorrectly requiring the optional lambda-declarator gareth@ignition-web.co.uk
  2020-11-17 15:44 ` [Bug c++/97839] " mpolacek at gcc dot gnu.org
  2020-11-17 16:01 ` mpolacek at gcc dot gnu.org
@ 2020-11-21 20:36 ` cvs-commit at gcc dot gnu.org
  2020-11-21 20:50 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-21 20:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97839

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:78cd6a63ee67ed854fbe54dd7c0a500dc138459a

commit r11-5230-g78cd6a63ee67ed854fbe54dd7c0a500dc138459a
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Nov 17 11:38:25 2020 -0500

    c++: Allow template lambdas without lambda-declarator [PR97839]

    Our implementation of template lambdas incorrectly requires the optional
    lambda-declarator.  This was probably required by an early draft of
    generic lambdas, but now the production is [expr.prim.lambda.general]:

     lambda-expression:
        lambda-introducer lambda-declarator [opt] compound-statement
        lambda-introducer < template-parameter-list > requires-clause [opt]
              lambda-declarator [opt] compound-statement

    Therefore, we should accept the following test.

    gcc/cp/ChangeLog:

            PR c++/97839
            * parser.c (cp_parser_lambda_declarator_opt): Don't require ().

    gcc/testsuite/ChangeLog:

            PR c++/97839
            * g++.dg/cpp2a/lambda-generic8.C: New test.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97839] Template lambda incorrectly requiring the optional lambda-declarator
  2020-11-15 15:11 [Bug c++/97839] New: Template lambda incorrectly requiring the optional lambda-declarator gareth@ignition-web.co.uk
                   ` (2 preceding siblings ...)
  2020-11-21 20:36 ` cvs-commit at gcc dot gnu.org
@ 2020-11-21 20:50 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-21 20:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97839

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-21 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 15:11 [Bug c++/97839] New: Template lambda incorrectly requiring the optional lambda-declarator gareth@ignition-web.co.uk
2020-11-17 15:44 ` [Bug c++/97839] " mpolacek at gcc dot gnu.org
2020-11-17 16:01 ` mpolacek at gcc dot gnu.org
2020-11-21 20:36 ` cvs-commit at gcc dot gnu.org
2020-11-21 20:50 ` mpolacek at gcc dot gnu.org

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).