The test has been done in GCC 2.95 under a Redhat Linux 6.0 (compiled by myself), but it is likely to be independent of the operating system. The problem is that GCC does allow the user of a class to access any typedefs that it has, even if they are protected or private.