This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/88313] New: generic lambda in default template argument


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

            Bug ID: 88313
           Summary: generic lambda in default template argument
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blitzrakete at gmail dot com
  Target Milestone: ---

gcc (with no flags) rejects the following code:

// 'auto' parameter not permitted in this context
template <int = [](auto) { return 0; }(1)>
void f();

This is bogus because anywhere where a non-generic lambda is allowed, a generic
one is allowed too. Replacing 'auto' with 'int' makes gcc accept the code.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]