[PATCH] D36572: Implemented P0409R2 - Allow lambda capture [=, this]

Faisal Vali via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 13 07:49:14 PDT 2017


faisalv added inline comments.


================
Comment at: lib/Sema/SemaLambda.cpp:959
+                         ? diag::ext_equals_this_lambda_capture_cxx2a
+                         : diag::warn_cxx1z_compat_equals_this_lambda_capture);
 
----------------
Shouldn't we try and hit the 'continue' (that u deleted) if warnings (and extension warnings) are turned into errors? 


================
Comment at: test/SemaCXX/cxx2a-lambda-equals-this.cpp:6
+// Deleting the copy constructor ensures that an [=, this] capture doesn't copy the object.
+// Accessing a member variable from the lambda ensures that the capture actually works.
+class A {
----------------
Nice - I wish we had (and that I had placed) more comments such as these in our test files :) 


https://reviews.llvm.org/D36572





More information about the cfe-commits mailing list