Member hiding (as a result of private or protected inheritance) can lead to type casting problems. This is because up casting a subclass that has inheritance limiters can reexpose members that are less restricted in the superclass.
Listing 5 illustrate this kind of problem.
Listing 5: | upcastproblem |
The error reported by g++ is “error: ’A’ is an inaccessible base of ’C’ ”.