https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/67948
>From ad0df2131e12c59e57b603b955626e27e3067505 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov <serebrennikov.vladis...@gmail.com> Date: Mon, 2 Oct 2023 08:12:56 +0300 Subject: [PATCH 1/2] [clang] Add test for CWG472 --- clang/test/CXX/drs/dr4xx.cpp | 17 +++++++++++++++++ clang/www/cxx_dr_status.html | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp index d8bdf49d0b2dde..cc12e9f158061f 100644 --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -924,6 +924,23 @@ namespace dr471 { // dr471: yes struct H : B, G { int f() { return n; } }; // expected-error {{private}} } +namespace dr472 { // dr472: no drafting +struct B { + int i; // #dr472-i-decl +}; +struct I : protected B {}; // #dr472-inheritance +struct D : public I { + void f(I *ip) { + ip->i = 0; + // expected-error@-1 {{'i' is a protected member of 'dr472::B'}} + // expected-note@#dr472-inheritance {{constrained by protected inheritance here}} + // expected-note@#dr472-i-decl {{member is declared here}} + B *bp = ip; + bp->i = 5; + } +}; +} + namespace dr474 { // dr474: yes namespace N { struct S { diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index ee9712e9bab994..b02f7ccfd37141 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -2871,7 +2871,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2> <td><a href="https://cplusplus.github.io/CWG/issues/472.html">472</a></td> <td>drafting</td> <td>Casting across protected inheritance</td> - <td align="center">Not resolved</td> + <td class="none" align="center">No</td> </tr> <tr id="473"> <td><a href="https://cplusplus.github.io/CWG/issues/473.html">473</a></td> >From 605622e34d2d82a4774890a3c96acdbf3f7f15a8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov <serebrennikov.vladis...@gmail.com> Date: Thu, 11 Jan 2024 01:31:45 +0300 Subject: [PATCH 2/2] Update expected directives --- clang/test/CXX/drs/dr4xx.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp index 1c7cd9b92a9712..1c7924e30f75b9 100644 --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -1057,15 +1057,15 @@ namespace dr471 { // dr471: 2.8 namespace dr472 { // dr472: no drafting struct B { - int i; // #dr472-i-decl + int i; // #dr472-i }; -struct I : protected B {}; // #dr472-inheritance +struct I : protected B {}; // #dr472-struct-I struct D : public I { void f(I *ip) { ip->i = 0; - // expected-error@-1 {{'i' is a protected member of 'dr472::B'}} - // expected-note@#dr472-inheritance {{constrained by protected inheritance here}} - // expected-note@#dr472-i-decl {{member is declared here}} + // expected-error@-1 {{'i' is a protected member of 'dr472::B'}} + // expected-note@#dr472-struct-I {{constrained by protected inheritance here}} + // expected-note@#dr472-i {{member is declared here}} B *bp = ip; bp->i = 5; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits