public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54764] New: In class initialization of non-static lambda member can't be used in class with default template paramer
@ 2012-10-01  6:43 leonid at volnitsky dot com
  2012-10-01 11:55 ` [Bug c++/54764] " daniel.kruegler at googlemail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: leonid at volnitsky dot com @ 2012-10-01  6:43 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54764

             Bug #: 54764
           Summary: In class initialization of non-static lambda member
                    can't be used in class with default template paramer
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: leonid@volnitsky.com


Clang-3.2 compiles (FWIW), but rejected by GCC 4.7.1 and 4.8:

------------------------------------------------------------------
#include <functional>

template<class T=void>
struct  c{
    std::function<int(int)> f = [](int i){return i+i;};
};

int main() {}
-------------------------------------------------------------------

Error message:

t.cc:6:31: error: default argument for template parameter for class enclosing
‘struct __lambda0’
  function<int(int)> f = [](int i){return i+i;};
                               ^


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

end of thread, other threads:[~2013-03-23  5:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01  6:43 [Bug c++/54764] New: In class initialization of non-static lambda member can't be used in class with default template paramer leonid at volnitsky dot com
2012-10-01 11:55 ` [Bug c++/54764] " daniel.kruegler at googlemail dot com
2012-10-01 12:09 ` paolo.carlini at oracle dot com
2013-03-12 21:41 ` jason at gcc dot gnu.org
2013-03-17  2:40 ` jason at gcc dot gnu.org
2013-03-23  5:09 ` 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).