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++/62219] New: [c++11] Spurious error for lambda in a friend function of a class template with a default template parameters


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

            Bug ID: 62219
           Summary: [c++11] Spurious error for lambda in a friend function
                    of a class template with a default template parameters
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com

This code:

    template< class = void >
    struct S
    {
      friend void foo( S )
      {
        [](){};
      }
    };

Gives me:

    test.cpp: In function âvoid foo(S< <template-parameter-1-1> >)â:
    test.cpp:6:8: error: default argument for template parameter for class
enclosing âfoo(S< <template-parameter-1-1> >)::<lambda>â
         [](){};
            ^

I'm not sure what the error is trying to tell me. FWIW, the code compiles
cleanly with clang.

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