BUG: C2248 When Access Protected Nested Class in Derived Class
Article ID: 122370
Article Last Modified on 7/5/2005
APPLIES TO
- Microsoft Visual C++ 1.0 Professional Edition
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q122370
SYMPTOMS
In the sample code in this article, class C2 is derived from C1, and
contains nested class S2, which is derived from nested class S1, declared
in class C1. Compiling the sample code results in the following compiler
error:
error C2248: 'S1' : cannot access protected class declared
in class 'C1'
RESOLUTION
Declare nested class C1::S1 as public.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Additional query words: kbVC400bug 8.00 8.00c 9.00 10.00 10.10 10.20 buglist1.00 buglist1.50 buglist1.51 buglist2.00 buglist7.00
Keywords: kbbug kbcpponly kbcompiler KB122370