The compilation of the next example :
class A
{
public:
void foo()
{
}
};
class B : private A
{
public:
using A::foo;
};
int main()
{
typedef void (B::*mf)();
mf func = &B::foo;
B b;
(b.*func)();
}
fails with next errors :
main.cpp||In function ‘int main()’:
main.cpp|18|error: ‘A’ is an inaccessible base of ‘B’
main.cpp|18|error: in pointer to member function conversion
I understand that the A is not accessible base of B, but I am using the using
keyword. Shouldn't it allow the access to the function foo?
What are relevant paragraphs in the standard that prevents the above to be compiled?