Hi,
A few years ago, I was trying to fix the bug 6840 [1] that relates to access to
static protected member from friends of derived classes.
I made a patch that fixes it at the time, but it was rejected because this was
considered as a drafting error in the standard [2].
Recently, I attended a talk by a Debian dev who tried to compile all debian
packages with clang. And that bug was one frequent cause of compilation error.
[3]
I was wondering if it was not time to revisit the decision, and consider that
this issue should be fixed after all.
The problem is the following:
class N { protected: static int m; };
class P : public N { friend class R; };
class R {
int foo() {
return N::m; // should work because the access is given via P.
// but clang gives an error:
// error: 'm' is a protected member of 'N'
}
};
C++11 §11.4 explicitly states this is permitted, with an example. And gcc
supports that fine.
Opinions?