[PATCH] D142381: [clang] Add test for CWG1960

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 23 09:43:46 PST 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://reviews.llvm.org/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."


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142381

Files:
  clang/test/CXX/drs/dr19xx.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
@@ -11567,7 +11567,7 @@
     <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>
Index: clang/test/CXX/drs/dr19xx.cpp
===================================================================
--- clang/test/CXX/drs/dr19xx.cpp
+++ clang/test/CXX/drs/dr19xx.cpp
@@ -167,6 +167,27 @@
 #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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142381.491415.patch
Type: text/x-patch
Size: 1105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230123/3bc2b5f9/attachment.bin>


More information about the cfe-commits mailing list