Open 991901f3-cc14-4404-b340-165691b62a58 opened 11 years ago
Sorry about that! I interpreted "Status: drafting" as tacit agreement that there was consensus on how to handle this case.
DR472 is still open, and the current wording on the core issues list is incorrect. We don't yet know what the revised rule will be, but I expect it'll end up mirroring 11.4/1's wording to the extent possible.
(FWIW, I've started to track Clang's state on various DRs at http://clang.llvm.org/cxx_dr_status.html, but I've not got as far as this one yet)
clang and gcc error today:
/tmp/issue16602.cpp:25:10: error: 'm' is a protected member of 'B'
25 | n2p->m = 0; // error (cf 11.4 [class.protected]) for the same reason
| ^
/tmp/issue16602.cpp:18:11: note: constrained by protected inheritance here
18 | class N2: protected B { };
| ^~~~~~~~~~~
/tmp/issue16602.cpp:3:7: note: member is declared here
3 | int m;
| ^
1 error generated.
CC @Endilll
Yeah, I'll get back to C++ DRs at some point.
@llvm/issue-subscribers-clang-frontend
We don't issue a diagnostic for the key test case, so this is not resolved yet.
Extended Description
Per http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#472 we should not allow the following code:
GCC correctly raises a diagnostic.