FIX: Access to Nested Base Class Member Functions Blocked (167749)
The information in this article applies to:
- 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 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 Q167749 SYMPTOMS
When a class derived from a nested class calls a base class member function
explicitly, the compiler generates error C2352 (relative to the sample
code below):
main.cpp(13) : error C2352: 'A::B::f' : illegal call of non-static
member function
RESOLUTION
In the definition of the derived class, use typedef to define an alias for the base class (see the sample code), and use this alias to qualify calls to the base class methods.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Microsoft Visual C++ .NET.
Modification Type: | Major | Last Reviewed: | 12/8/2003 |
---|
Keywords: | kbBug kbfix kbLangCPP kbNoUpdate kbProgramming KB167749 |
---|
|