$ cat test.c

void foo(...);

template <typename... TT>
void bar1(TT... tt)
{
    auto my_precious = [=](){ foo(tt...); };
}


template <typename... TT>
void bar2(TT... tt)
{
    auto my_precious = [&](){ foo(tt...); };
}

$ arm-elf-g++.exe -std=gnu++0x -c test.c
test.c: In lambda function:
test.c:7:35: error: parameter packs not expanded with '...':
test.c:7:35: note:         'tt'
test.c:7:37: error: expansion pattern '((const bar1(TT
...)::<lambda()>*)this)->bar1(TT ...)::<lambda()>::tt' contains no argument
packs
test.c: In lambda function:
test.c:14:35: error: parameter packs not expanded with '...':
test.c:14:35: note:         'tt'
test.c:14:37: error: expansion pattern '((const bar2(TT
...)::<lambda()>*)this)->bar2(TT ...)::<lambda()>::tt' contains no argument
packs

This is with svn rev 153796.

Bug 41933 could be related to this.


-- 
           Summary: function parameter pack inaccessible inside lambda
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bruck dot michael at googlemail dot com
  GCC host triplet: i686-pc-cygwin
GCC target triplet: arm-unknown-elf


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

Reply via email to