public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53783] New: [4.8 Regression] lambda in lambda in template function rejected
@ 2012-06-26 22:53 lunow at math dot hu-berlin.de
  2012-06-27  9:31 ` [Bug c++/53783] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lunow at math dot hu-berlin.de @ 2012-06-26 22:53 UTC (permalink / raw)
  To: gcc-bugs

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’


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

end of thread, other threads:[~2012-09-10 23:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26 22:53 [Bug c++/53783] New: [4.8 Regression] lambda in lambda in template function rejected lunow at math dot hu-berlin.de
2012-06-27  9:31 ` [Bug c++/53783] " rguenth at gcc dot gnu.org
2012-07-03  5:03 ` jason at gcc dot gnu.org
2012-07-03  5:06 ` jason at gcc dot gnu.org
2012-09-10 23:51 ` 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).