public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96485] New: Lambda parsing regression in GCCs 9 and onwards
@ 2020-08-05 14:07 s_gccbugzilla at nedprod dot com
  2020-08-05 17:48 ` [Bug c++/96485] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: s_gccbugzilla at nedprod dot com @ 2020-08-05 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96485
           Summary: Lambda parsing regression in GCCs 9 and onwards
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: s_gccbugzilla at nedprod dot com
  Target Milestone: ---

As the repro at https://godbolt.org/z/Gvx75e shows, the following code compiled
fine in GCCs up to and including GCC 8.3:

```
void test()
{
    []()
#if 1
    __attribute__((no_sanitize_undefined))
#endif
    ->int {
        return 0;
    };
}
```

>From GCC 9 onwards, we get:

```
<source>: In lambda function:
<source>:7:5: error: expected '{' before '->' token
    7 |     ->int {
      |     ^~
<source>: In function 'void test()':
<source>:7:5: error: base operand of '->' has non-pointer type
'test()::<lambda()>'
<source>:7:7: error: expected unqualified-id before 'int'
    7 |     ->int {
      |       ^~~
Compiler returned: 1
```

This code compiles fine in clang, incidentally, though it doesn't recognise the
attribute.

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

end of thread, other threads:[~2021-02-26  4:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 14:07 [Bug c++/96485] New: Lambda parsing regression in GCCs 9 and onwards s_gccbugzilla at nedprod dot com
2020-08-05 17:48 ` [Bug c++/96485] " jakub at gcc dot gnu.org
2020-08-05 17:50 ` jakub at gcc dot gnu.org
2020-08-05 18:13 ` s_gccbugzilla at nedprod dot com
2020-08-06  7:32 ` [Bug c++/96485] [9/10/11 Regression] " rguenth at gcc dot gnu.org
2021-01-14  9:18 ` rguenth at gcc dot gnu.org
2021-02-26  4:13 ` jason 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).