BUG: C2248 When Access Protected Nested Class in Derived Class (122370)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
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.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbCompiler kbCPPonly KB122370 |
---|
|