[clang] 839eae3 - [clang] Add test for CWG1960
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 26 03:40:54 PST 2023
Author: Vlad Serebrennikov
Date: 2023-01-26T14:40:47+03:00
New Revision: 839eae38a4e4064568e1b3b0ee9538958ead8a40
URL: https://github.com/llvm/llvm-project/commit/839eae38a4e4064568e1b3b0ee9538958ead8a40
DIFF: https://github.com/llvm/llvm-project/commit/839eae38a4e4064568e1b3b0ee9538958ead8a40.diff
LOG: [clang] Add test for CWG1960
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
Added:
Modified:
clang/test/CXX/drs/dr19xx.cpp
clang/www/cxx_dr_status.html
Removed:
################################################################################
diff --git a/clang/test/CXX/drs/dr19xx.cpp b/clang/test/CXX/drs/dr19xx.cpp
index 08ee2ee77a84f..65a14da66f974 100644
--- a/clang/test/CXX/drs/dr19xx.cpp
+++ b/clang/test/CXX/drs/dr19xx.cpp
@@ -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 {
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 0c621a7894340..b54c65e034066 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -11567,7 +11567,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<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>
More information about the cfe-commits
mailing list