public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100091] New: decltype([]{}) rejected as a default template parameter
@ 2021-04-15  7:05 pilarlatiesa at gmail dot com
  2021-04-15  8:21 ` [Bug c++/100091] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pilarlatiesa at gmail dot com @ 2021-04-15  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100091
           Summary: decltype([]{}) rejected as a default template
                    parameter
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pilarlatiesa at gmail dot com
  Target Milestone: ---

This piece of code is accepted by 10.2, but rejected by yesterday's (20210414)
snapshot:

$ cat test.cpp

  template<typename = decltype([]{})>
  void f() {}

$ ../GCC-11/bin/g++ -std=c++20 -c test.cpp

test.cpp:2:30: error: lambda-expression in template parameter type
    2 | template<typename = decltype([]{})>
      |

It's a recent change in behaviour. Possibly caused by
r11-8166-ge1666ebd9ad31dbd8b9b933c883bdd882cfd1522.

I'm labeling this as rejects-valid because I believe [basic.def.odr]/14 allows
such an use of a lambda, but I hardly understand that wording.

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

end of thread, other threads:[~2023-07-07  9:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15  7:05 [Bug c++/100091] New: decltype([]{}) rejected as a default template parameter pilarlatiesa at gmail dot com
2021-04-15  8:21 ` [Bug c++/100091] [11 Regression] " rguenth at gcc dot gnu.org
2021-04-15 11:50 ` marxin at gcc dot gnu.org
2021-04-15 12:33 ` rguenth at gcc dot gnu.org
2021-04-15 13:32 ` pilarlatiesa at gmail dot com
2021-04-15 15:25 ` jason at gcc dot gnu.org
2021-04-15 16:56 ` jason at gcc dot gnu.org
2023-07-07  9:30 ` rguenth 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).