Skip to content

Commit 839eae3

Browse files
committed
[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
1 parent 5ccd288 commit 839eae3

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

clang/test/CXX/drs/dr19xx.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,27 @@ namespace dr1959 { // dr1959: 3.9
167167
#endif
168168
}
169169

170+
namespace dr1960 { // dr1960: no
171+
struct A {
172+
void f() {}
173+
protected:
174+
void g() {}
175+
};
176+
177+
struct B: A {
178+
private:
179+
using A::f;
180+
using A::g;
181+
};
182+
183+
struct C : B {
184+
// FIXME: both declarations are ill-formed, because A::f and A::g
185+
// are not accessible.
186+
using A::f;
187+
using A::g;
188+
};
189+
}
190+
170191
namespace dr1966 { // dr1966: 11
171192
#if __cplusplus >= 201103L
172193
struct A {

clang/www/cxx_dr_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11567,7 +11567,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1156711567
<td><a href="https://wg21.link/cwg1960">1960</a></td>
1156811568
<td>NAD</td>
1156911569
<td>Visibility of entity named in class-scope <I>using-declaration</I></td>
11570-
<td class="none" align="center">Unknown</td>
11570+
<td class="none" align="center">No</td>
1157111571
</tr>
1157211572
<tr id="1961">
1157311573
<td><a href="https://wg21.link/cwg1961">1961</a></td>

0 commit comments

Comments
 (0)