https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/67948
https://cplusplus.github.io/CWG/issues/472.html It has drafting status, but I think CWG has reached consesus on the behavior. >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] [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 d8bdf49d0b2dde7..cc12e9f158061f8 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 ee9712e9bab9949..b02f7ccfd371411 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> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits