public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51979] New: variadic templates + lambda capture list = error
@ 2012-01-24 11:15 i.nixman at gmail dot com
  2012-01-24 12:56 ` [Bug c++/51979] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: i.nixman at gmail dot com @ 2012-01-24 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51979
           Summary: variadic templates + lambda capture list = error
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: i.nixman@gmail.com


The following code:
template <class... Args> void foo(Args... args) {}
template <class... Args> void bar(Args... args) {
   auto lambda = [=, args...]() {
      foo(args...);
   };
}

produce this error:
>g++ -std=c++0x lambd.cpp -olambd
lambd.cpp: In function 'void bar(Args ...)':
lambd.cpp:3:25: error: expected ',' before '...' token
lambd.cpp:3:25: error: expected identifier before '...' token
lambd.cpp:3:28: error: parameter packs not expanded with '...':
lambd.cpp:3:28: note:         'args'
lambd.cpp: In lambda function:
lambd.cpp:4:13: error: expansion pattern '((const bar(Args
...)::<lambda()>*)this)->bar(Args ...)::<lambda()>::args' contains no argument
packs

example from c++ draft 5.1.2.23:
template<class... Args>
void f(Args... args) {
   auto lm = [&, args...] { return g(args...); };
   lm();
}


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

* [Bug c++/51979] variadic templates + lambda capture list = error
  2012-01-24 11:15 [Bug c++/51979] New: variadic templates + lambda capture list = error i.nixman at gmail dot com
@ 2012-01-24 12:56 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-24 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-24 11:56:18 UTC ---
Known issue.

*** This bug has been marked as a duplicate of bug 41933 ***


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

end of thread, other threads:[~2012-01-24 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-24 11:15 [Bug c++/51979] New: variadic templates + lambda capture list = error i.nixman at gmail dot com
2012-01-24 12:56 ` [Bug c++/51979] " paolo.carlini at oracle dot com

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).