[clang] 7e31d07 - [clang] Add test for CWG600

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 01:42:41 PST 2022


Author: Vlad Serebrennikov
Date: 2022-12-06T12:42:35+03:00
New Revision: 7e31d0723dbf8ab9355cb58cfc6309be51be3e25

URL: https://github.com/llvm/llvm-project/commit/7e31d0723dbf8ab9355cb58cfc6309be51be3e25
DIFF: https://github.com/llvm/llvm-project/commit/7e31d0723dbf8ab9355cb58cfc6309be51be3e25.diff

LOG: [clang] Add test for CWG600

P1787: //CWG600 is resolved by explaining that accessibility affects naming a member in the sense of the ODR.//
Wording: see changes to [class.access] p1 and p4.
Additional references: [[ http://eel.is/c++draft/basic.def.odr#8.sentence-2 | basic.def.odr/8 ]]: //A function is odr-used if it is named by a potentially-evaluated expression or conversion.//

Reviewed By: #clang-language-wg, aaron.ballman

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/test/CXX/drs/dr6xx.cpp b/clang/test/CXX/drs/dr6xx.cpp
index 494d857e829a..f9925e22085b 100644
--- a/clang/test/CXX/drs/dr6xx.cpp
+++ b/clang/test/CXX/drs/dr6xx.cpp
@@ -3,6 +3,22 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+
+namespace dr600 { // dr600: yes
+struct S {
+  void f(int);
+
+private:
+  void f(double); // expected-note {{declared private here}}
+};
+
+void g(S *sp) {
+  sp->f(2);
+  // access control is applied after overload resolution
+  sp->f(2.2); // expected-error {{is a private member}}
+}
+} // namespace dr600
 
 namespace std {
   struct type_info {};

diff  --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index d5f52b3bc9d6..33ab66fcbeb6 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -3641,7 +3641,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://wg21.link/cwg600">600</a></td>
     <td>CD6</td>
     <td>Does access control apply to members or to names?</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="601">
     <td><a href="https://wg21.link/cwg601">601</a></td>


        


More information about the cfe-commits mailing list