[clang] 653a82e - [clang] Add test for CWG191

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 06:54:45 PDT 2023


Author: Vlad Serebrennikov
Date: 2023-04-07T17:54:38+04:00
New Revision: 653a82e95257a7cd3f22c24e40d54459a6608429

URL: https://github.com/llvm/llvm-project/commit/653a82e95257a7cd3f22c24e40d54459a6608429
DIFF: https://github.com/llvm/llvm-project/commit/653a82e95257a7cd3f22c24e40d54459a6608429.diff

LOG: [clang] Add test for CWG191

Also mark CWG1200 as "na."

[[https://wg21.link/p1787 | 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)

Reviewed By: #clang-language-wg, shafik

Differential Revision: https://reviews.llvm.org/D147530

Added: 
    

Modified: 
    clang/test/CXX/drs/dr12xx.cpp
    clang/test/CXX/drs/dr1xx.cpp
    clang/www/cxx_dr_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/CXX/drs/dr12xx.cpp b/clang/test/CXX/drs/dr12xx.cpp
index 9f09ff1f698e5..863e5be9a5d16 100644
--- a/clang/test/CXX/drs/dr12xx.cpp
+++ b/clang/test/CXX/drs/dr12xx.cpp
@@ -1,7 +1,11 @@
 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+
+// dr1200: na
 
 namespace dr1213 { // dr1213: 7
 #if __cplusplus >= 201103L

diff  --git a/clang/test/CXX/drs/dr1xx.cpp b/clang/test/CXX/drs/dr1xx.cpp
index 02ad3109bfcb7..f70cd20133ebc 100644
--- a/clang/test/CXX/drs/dr1xx.cpp
+++ b/clang/test/CXX/drs/dr1xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace dr100 { // dr100: yes
   template<const char (*)[4]> struct A {}; // expected-note 0-1{{declared here}}
@@ -999,6 +1000,36 @@ namespace dr188 { // dr188: yes
 
 // 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

diff  --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 0e1101e3d42ca..8ca6d081379d8 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <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>
@@ -7007,7 +7007,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://wg21.link/cwg1200">1200</a></td>
     <td>CD6</td>
     <td>Lookup rules for template parameters</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="1201">
     <td><a href="https://wg21.link/cwg1201">1201</a></td>


        


More information about the cfe-commits mailing list