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

* [Bug c++/53783] [4.8 Regression] lambda in lambda in template function rejected
  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 ` rguenth at gcc dot gnu.org
  2012-07-03  5:03 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-27  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug c++/53783] [4.8 Regression] lambda in lambda in template function rejected
  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
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2012-07-03  5:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2012-07-03 05:03:28 UTC ---
Author: jason
Date: Tue Jul  3 05:03:21 2012
New Revision: 189190

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189190
Log:
    PR c++/53783
    * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
    for LAMBDA_EXPR_EXTRA_SCOPE.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/53783] [4.8 Regression] lambda in lambda in template function rejected
  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
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2012-07-03  5:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2012-07-03 05:06:30 UTC ---
Fixed.


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

* [Bug c++/53783] [4.8 Regression] lambda in lambda in template function rejected
  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
                   ` (2 preceding siblings ...)
  2012-07-03  5:06 ` jason at gcc dot gnu.org
@ 2012-09-10 23:51 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-10 23:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-10 23:51:41 UTC ---
Author: jason
Date: Mon Sep 10 23:51:34 2012
New Revision: 191164

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191164
Log:
    PR c++/54538
    PR c++/53783
    * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Go back to using RECUR
    for LAMBDA_EXPR_EXTRA_SCOPE except for function scope.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle4.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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