[PATCH] D147530: [clang] Add test for CWG191

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 06:34:54 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>: CWG191 and CWG1200 are resolved by defining unqualified lookup in terms of every enclosing scope.
Wording: If no declarations are found, the results of the unqualified search are the results of an unqualified search in the parent scope of S, if any, from P. ([basic.lookup.unqual]/2)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147530

Files:
  clang/test/CXX/drs/dr1xx.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
@@ -1183,7 +1183,7 @@
     <td><a href="https://wg21.link/cwg191">191</a></td>
     <td>CD6</td>
     <td>Name lookup does not handle complex nesting</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="192">
     <td><a href="https://wg21.link/cwg192">192</a></td>
Index: clang/test/CXX/drs/dr1xx.cpp
===================================================================
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -999,6 +999,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+    struct outer {
+      static int i;
+      struct inner {
+        void f() {
+          struct local {
+            void g() {
+              i = 5;
+            }
+          };
+        }
+      };
+    };
+  }
+
+  namespace example2 {
+    struct S {
+      void f() {
+        struct local2 {
+          void g() {
+            dr191_j = 5;
+          }
+        };
+      }
+    };
+  }
+}
+
 // dr193 FIXME: add codegen test
 
 namespace dr194 { // dr194: yes


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147530.510777.patch
Type: text/x-patch
Size: 1285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230404/1039f7e4/attachment-0001.bin>


More information about the cfe-commits mailing list