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



kpx1894 <kpx1894 at gmail dot com> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |kpx1894 at gmail dot com



--- Comment #7 from kpx1894 <kpx1894 at gmail dot com> 2012-12-07 15:18:03 UTC 
---

This bug is still present in GCC 4.7.2. There are cases where capturing "this"

(as a workaround) is not possible:

----------

#include <iostream>



struct Test

{

    void (*get())()

    {

        return [](){ Test::sf(); };

    }



    static void sf()

    {

        std::cout << "Test::sf" << std::endl;

    }



};



int main()

{

    Test test;



    auto f = test.get();

    (*f)();

}

----------

Reply via email to