This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56401] New: Lambda's this pointer are not initialized inside template classes


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

             Bug #: 56401
           Summary: Lambda's this pointer are not initialized inside
                    template classes
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gonzalobg88@gmail.com


Created attachment 29502
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29502
The first lambda produces a warning. It compiles but the program behaves wrong.
The second lambda crashes the compiler.

Compiling with: "g++-4.7.2 -std=c++11 -Wall -Wextra"

The first lambda produces the following warnign:
"warning: missing initializer for member âB<D>::foo() [with D =
void]::lambda()>::__thisâ [-Wmissing-field-initializers]"

It recognizes that it has to capture the this pointer, but it does not
initialize it. The code compiles and the executable does not print 10 as it
should.

The second lambda crashes gcc with the following error:
"internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1035"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]