[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 23 15:21:09 PDT 2018


rsmith added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6636-6638
+  def warn_cxx14_compat_parameter_shadow_capture : ExtWarn<
+    "a lambda parameter that shadows a capture is incompatible with C++ "
+    "standards before C++17">, InGroup<CXXPre17Compat>;
----------------
Please just unconditionally reject this. We don't need to support this as an extension (right?) and our policy is that DRs apply retroactively (unless we have some good reason for them to not do so).


================
Comment at: www/cxx_dr_status.html:13084
     <td>Hiding by lambda captures and parameters</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Clang 8</td>
   </tr>
----------------
This file is autogenerated, please do not edit it manually.

Instead, you should add a suitable test in test/CXX/drs, with a `// dr2211: 8` comment to indicate that this DR is addressed in Clang 8, and rerun the makx_cxx_dr_status script to regenerate this file. (You'll need to download a recent cwg_index.html file; the script uses it as input.)


Repository:
  rC Clang

https://reviews.llvm.org/D53595





More information about the cfe-commits mailing list