[PATCH] D139326: [clang] Add test for CWG952
Vlad Serebrennikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 6 01:27:46 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5b22c5129c11: [clang] Add test for CWG952 (authored by Endill).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139326/new/
https://reviews.llvm.org/D139326
Files:
clang/test/CXX/drs/dr9xx.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
@@ -5520,7 +5520,7 @@
<td><a href="https://wg21.link/cwg952">952</a></td>
<td>CD6</td>
<td>Insufficient description of “naming class”</td>
- <td class="none" align="center">Unknown</td>
+ <td class="full" align="center">Yes</td>
</tr>
<tr id="953">
<td><a href="https://wg21.link/cwg953">953</a></td>
Index: clang/test/CXX/drs/dr9xx.cpp
===================================================================
--- clang/test/CXX/drs/dr9xx.cpp
+++ clang/test/CXX/drs/dr9xx.cpp
@@ -1,11 +1,9 @@
// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-
-#if __cplusplus < 201103L
-// expected-no-diagnostics
-#endif
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
namespace std {
__extension__ typedef __SIZE_TYPE__ size_t;
@@ -74,6 +72,34 @@
#endif
}
+namespace dr952 { // dr952: yes
+struct A {
+ typedef int I; // #dr952-typedef-decl
+};
+struct B : private A { // #dr952-inheritance
+};
+struct C : B {
+ void f() {
+ I i1; // expected-error {{private member}}
+ // expected-note@#dr952-inheritance {{constrained by private inheritance}}
+ // expected-note@#dr952-typedef-decl {{declared here}}
+ }
+ I i2; // expected-error {{private member}}
+ // expected-note@#dr952-inheritance {{constrained by private inheritance}}
+ // expected-note@#dr952-typedef-decl {{declared here}}
+ struct D {
+ I i3; // expected-error {{private member}}
+ // expected-note@#dr952-inheritance {{constrained by private inheritance}}
+ // expected-note@#dr952-typedef-decl {{declared here}}
+ void g() {
+ I i4; // expected-error {{private member}}
+ // expected-note@#dr952-inheritance {{constrained by private inheritance}}
+ // expected-note@#dr952-typedef-decl {{declared here}}
+ }
+ };
+};
+} // namespace dr952
+
namespace dr974 { // dr974: yes
#if __cplusplus >= 201103L
void test() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139326.480381.patch
Type: text/x-patch
Size: 2564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221206/9b1dfb35/attachment.bin>
More information about the cfe-commits
mailing list