Summary: | Inconsistent `this->` required when calling member function in a lambda capturing `this` through another function | ||
---|---|---|---|
Product: | gcc | Reporter: | Vittorio Romeo <vittorio.romeo> |
Component: | c++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | daniel.kruegler, jaak, webrown.cpp |
Priority: | P3 | Keywords: | c++-lambda |
Version: | 6.0 | ||
Target Milestone: | 7.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Bug Depends on: | |||
Bug Blocks: | 54367 |
Description
Vittorio Romeo
2015-08-19 14:12:37 UTC
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. Fixed in 7.1.0, we already have testcases. |