[Bug c++/53783] New: [4.8 Regression] lambda in lambda in template function rejected

lunow at math dot hu-berlin.de gcc-bugzilla@gcc.gnu.org
Tue Jun 26 22:53:00 GMT 2012


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

             Bug #: 53783
           Summary: [4.8 Regression] lambda in lambda in template function
                    rejected
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: lunow@math.hu-berlin.de


The following valid program is rejected (using latest version from trunk)

template <class> void foo() { [] { [] {}; }; }
int main() { foo<void>(); }

daniel@daniel-VirtualBox:~/projects/Code/gcctest$ /opt/gcc/trunk/bin/g++
-std=c++11 test.cpp 
test.cpp: In instantiation of ‘foo() [with <template-parameter-1-1> =
void]::<lambda()>’:
test.cpp:1:32:   required from ‘struct foo() [with <template-parameter-1-1> =
void]::<lambda()>’
test.cpp:1:31:   required from ‘void foo() [with <template-parameter-1-1> =
void]’
test.cpp:2:24:   required from here
test.cpp:1:36: error: use of ‘foo() [with <template-parameter-1-1> =
void]::<lambda()>’ before deduction of ‘auto’
 template <class> void foo() { [] { [] {}; }; }
                                    ^
test.cpp: In instantiation of ‘struct foo() [with <template-parameter-1-1> =
void]::<lambda()>::<lambda()>’:
test.cpp:1:36:   required from ‘foo() [with <template-parameter-1-1> =
void]::<lambda()>’
test.cpp:1:32:   required from ‘struct foo() [with <template-parameter-1-1> =
void]::<lambda()>’
test.cpp:1:31:   required from ‘void foo() [with <template-parameter-1-1> =
void]’
test.cpp:2:24:   required from here
test.cpp:1:37: error: use of ‘foo() [with <template-parameter-1-1> =
void]::<lambda()>::<lambda()>’ before deduction of ‘auto’
 template <class> void foo() { [] { [] {}; }; }
                                     ^
test.cpp:1:37: error: invalid use of ‘auto’
test.cpp:1:37: error: inconsistent deduction for ‘auto’: ‘auto’ and then ‘void’



More information about the Gcc-bugs mailing list