This patch implements P0409R2.
'*this' capture is allowed pre-C++17 as an extension. So I've also allowed [=, this] pre-C++2a as an extension (with appropriate warnings) for consistency.
Differential D36572
Implemented P0409R2 - Allow lambda capture [=, this] hamzasood on Aug 10 2017, 4:19 AM. Authored by
Details
Diff Detail Event Timeline
Comment Actions @rjmccall The warning is emitted, but you're right that there's no test to ensure that actually happens; test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp used Wno-c++2a-extensions to suppress the warning. I've changed it so that checking for the warning is now part of the test.
Comment Actions OK - looks good enough to me. I say we give the rest of the reviewers until friday to chime in, and if no one blocks it, can you commit then?
Comment Actions It's Friday, so hopefully this is good to go. I've updated the patch so that it can be applied successfully to the latest revision. |
Shouldn't we try and hit the 'continue' (that u deleted) if warnings (and extension warnings) are turned into errors?