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

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