[clang] Add test for CWG1960
authorVlad Serebrennikov <serebrennikov.vladislav@gmail.com>
Thu, 26 Jan 2023 11:07:30 +0000 (14:07 +0300)
committerVlad Serebrennikov <serebrennikov.vladislav@gmail.com>
Thu, 26 Jan 2023 11:40:47 +0000 (14:40 +0300)
P1787: "CWG1960 (currently closed as NAD) is resolved by removing the rule in question (which is widely ignored by implementations and gives subtle interactions between using-declarations)."
Wording: "In a using-declarator that does not name a constructor, every declaration named shall be accessible."

Reviewed By: #clang-language-wg, erichkeane, shafik

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

clang/test/CXX/drs/dr19xx.cpp
clang/www/cxx_dr_status.html

index 08ee2ee..65a14da 100644 (file)
@@ -167,6 +167,27 @@ namespace dr1959 { // dr1959: 3.9
 #endif
 }
 
+namespace dr1960 { // dr1960: no
+struct A {
+void f() {}
+protected:
+void g() {}
+};
+
+struct B: A {
+private:
+using A::f;
+using A::g;
+};
+
+struct C : B {
+// FIXME: both declarations are ill-formed, because A::f and A::g
+// are not accessible.
+using A::f;
+using A::g;
+};
+}
+
 namespace dr1966 { // dr1966: 11
 #if __cplusplus >= 201103L
   struct A {
index 0c621a7..b54c65e 100755 (executable)
@@ -11567,7 +11567,7 @@ and <I>POD class</I></td>
     <td><a href="https://wg21.link/cwg1960">1960</a></td>
     <td>NAD</td>
     <td>Visibility of entity named in class-scope <I>using-declaration</I></td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr id="1961">
     <td><a href="https://wg21.link/cwg1961">1961</a></td>