[Bug c++/67274] Inconsistent `this->` required when calling member function in a lambda capturing `this` through another function

vittorio.romeo at outlook dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 19 14:13:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274

--- Comment #1 from Vittorio Romeo <vittorio.romeo at outlook dot com> ---
More test cases, using minor variations to the code posted above:

With bar() = call([this](auto x){ foo(x); });
clang++ 3.6+ compiles.
g++ 5.2+ does not compile.

With bar() = call([this](auto x){ this->foo(x); });
clang++ 3.6+ compiles.
g++ 5.2+ compiles.

With bar() = call([this](int x){ foo(x); });
clang++ 3.6+ compiles.
g++ 5.2+ compiles.

With bar() = [this](auto x){ foo(x); }(1);
clang++ 3.6+ compiles.
g++ 5.2+ compiles.



More information about the Gcc-bugs mailing list