public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55828] New: problem with access to static method from lambda in another method
@ 2012-12-29 10:08 vladimir.bayda at gmail dot com
  2013-01-07 23:09 ` [Bug c++/55828] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vladimir.bayda at gmail dot com @ 2012-12-29 10:08 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55828
           Summary: problem with access to static method from lambda in
                    another method
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vladimir.bayda@gmail.com


It looks like an issue.
When I'm trying to access to static method from lambda defined in another
method I'm getting following error:

Compilation finished with errors:
source.cpp: In lambda function:
source.cpp:7:22: error: 'this' was not captured for this lambda function


Sample code:
struct Test
{
   static void func1() {}
   void func2() 
   {
      auto f = []() {
         Test::func1();
      };
   }
};
int main()
{}

It's could be easily reproduced on gcc 4.7.3 and bellow.
I haven't checked iso standard for right behavior - but it seems msvc and clang
compilers work fine with this example.
Also it gets ok when I pass this to lambda.


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

* [Bug c++/55828] problem with access to static method from lambda in another method
  2012-12-29 10:08 [Bug c++/55828] New: problem with access to static method from lambda in another method vladimir.bayda at gmail dot com
@ 2013-01-07 23:09 ` daniel.kruegler at googlemail dot com
  2013-01-23 12:37 ` paolo.carlini at oracle dot com
  2013-03-04 18:16 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-01-07 23:09 UTC (permalink / raw)
  To: gcc-bugs


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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-01-07 23:09:07 UTC ---
The problem also exists for gcc 4.8.0 20121209 (experimental), I agree that the
code should be accepted.


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

* [Bug c++/55828] problem with access to static method from lambda in another method
  2012-12-29 10:08 [Bug c++/55828] New: problem with access to static method from lambda in another method vladimir.bayda at gmail dot com
  2013-01-07 23:09 ` [Bug c++/55828] " daniel.kruegler at googlemail dot com
@ 2013-01-23 12:37 ` paolo.carlini at oracle dot com
  2013-03-04 18:16 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-01-23 12:37 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-01-23
                 CC|vladimir.bayda at gmail dot |
                   |com                         |
             Blocks|                            |54367
     Ever Confirmed|0                           |1


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

* [Bug c++/55828] problem with access to static method from lambda in another method
  2012-12-29 10:08 [Bug c++/55828] New: problem with access to static method from lambda in another method vladimir.bayda at gmail dot com
  2013-01-07 23:09 ` [Bug c++/55828] " daniel.kruegler at googlemail dot com
  2013-01-23 12:37 ` paolo.carlini at oracle dot com
@ 2013-03-04 18:16 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2013-03-04 18:16 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-04 18:15:07 UTC ---
Same issue as 51494.

*** This bug has been marked as a duplicate of bug 51494 ***


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

end of thread, other threads:[~2013-03-04 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-29 10:08 [Bug c++/55828] New: problem with access to static method from lambda in another method vladimir.bayda at gmail dot com
2013-01-07 23:09 ` [Bug c++/55828] " daniel.kruegler at googlemail dot com
2013-01-23 12:37 ` paolo.carlini at oracle dot com
2013-03-04 18:16 ` 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).