[PATCH] D139090: [clang] Add test for CWG360

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 06:24:37 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f950ad58919: [clang] Add test for CWG360 (authored by Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139090/new/

https://reviews.llvm.org/D139090

Files:
  clang/test/CXX/drs/dr3xx.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
@@ -2200,7 +2200,7 @@
     <td><a href="https://wg21.link/cwg360">360</a></td>
     <td>CD6</td>
     <td>Using-declaration that reduces access</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr class="open" id="361">
     <td><a href="https://wg21.link/cwg361">361</a></td>
Index: clang/test/CXX/drs/dr3xx.cpp
===================================================================
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139090.479273.patch
Type: text/x-patch
Size: 1366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221201/d662dcd7/attachment-0001.bin>


More information about the cfe-commits mailing list