Any number of access specifiers is allowed and no particular order is required.
[Example 2: struct S {int a; // S::a is public by default: struct usedprotected:int b; // S::b is protectedprivate:int c; // S::c is privatepublic:int d; // S::d is public};
— end example]
In a derived class, the lookup of a base class name will find the
injected-class-name instead of the name of the base class in the scope
in which it was declared.
The injected-class-name might be less accessible
than the name of the base class in the scope in which it was declared.
— end note]
[Example 4: class A {};
class B :private A {};
class C :public B {
A* p; // error: injected-class-name A is inaccessible::A* q; // OK};
— end example]