[PATCH] D139173: [clang] Add test for CWG600
Vlad Serebrennikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 2 00:26:02 PST 2022
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>: //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: basic.def.odr/8 <http://eel.is/c++draft/basic.def.odr#8.sentence-2>: //A function is odr-used if it is named by a potentially-evaluated expression or conversion.//
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139173
Files:
clang/test/CXX/drs/dr6xx.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
@@ -3642,7 +3642,7 @@
<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>
Index: clang/test/CXX/drs/dr6xx.cpp
===================================================================
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -3,6 +3,21 @@
// 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);
+ sp->f(2.2); // expected-error {{is a private member}}
+}
+} // namespace dr600
namespace std {
struct type_info {};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139173.479531.patch
Type: text/x-patch
Size: 1431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221202/77930c74/attachment-0001.bin>
More information about the cfe-commits
mailing list