[PATCH] D147836: [clang] Add test for CWG1822

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 21:43:20 PDT 2023


Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 <https://wg21.link/p1787>: CWG1822 is resolved by specifying that the body of a lambda remains in the surrounding (function parameter) scope.
Wording: A parameter-declaration-clause P introduces a function parameter scope that includes P. <...> If P is associated with a lambda-declarator, its scope extends to the end of the compound-statement in the lambda-expression. ([basic.scope.param])


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147836

Files:
  clang/test/CXX/drs/dr18xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===================================================================
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -10739,7 +10739,7 @@
     <td><a href="https://wg21.link/cwg1822">1822</a></td>
     <td>CD6</td>
     <td>Lookup of parameter names in <I>lambda-expression</I>s</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="1823">
     <td><a href="https://wg21.link/cwg1823">1823</a></td>
Index: clang/test/CXX/drs/dr18xx.cpp
===================================================================
--- clang/test/CXX/drs/dr18xx.cpp
+++ clang/test/CXX/drs/dr18xx.cpp
@@ -50,6 +50,15 @@
 #endif
 }
 
+namespace dr1822 { // dr1822: yes
+#if __cplusplus >= 201103L
+  int a;
+  auto x = [] (int a) {
+#pragma clang __debug dump a // CHECK: ParmVarDecl
+  };
+#endif
+}
+
 namespace dr1872 { // dr1872: 9
 #if __cplusplus >= 201103L
   template<typename T> struct A : T {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147836.511846.patch
Type: text/x-patch
Size: 996 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230408/9c93ec4e/attachment.bin>


More information about the cfe-commits mailing list