FIX: Missing '::' in Error C2579 for Ambiguous OverloadLast reviewed: September 18, 1997Article ID: Q131203 |
2.00 2.10
WINDOWS NT
kbtool kbfixlist
The information in this article applies to:
SYMPTOMSA member function that is an ambiguous overload of another member function of the class causes the compiler to generate a correct C2579 error message to indicate that the parameter list is not sufficiently different to overload the function. This behavior is as it should be. However, in the error message, the scope resolution operator (::) is missing between the class name and the function name used to indicate the problem. For example, compiling the sample code shown in article causes the compiler to generate this error :
error C2579: 'TestClassTestFunc(int)' : parameter list not sufficiently different from 'TestClassTestFunc(const int)'The error should look like this:
error C2579: 'TestClass::TestFunc(int)' : parameter list not sufficiently different from 'TestClass::TestFunc(const int)'This only happens with Visual C++, 32-bit Edition, versions 2.0 and 2.1. This does not happen with Visual C++ version 1.0 for Windows NT nor does it happen with the 16-bit versions of Visual C++. NOTE: In Visual C++ 4.0, the text message of error C2579 has been corrected. It now appears as follows:
error C2579: '<function_name>(<parameter_list1>)' : parameter list not sufficiently different from '<function_name>(<parameter_list2>)' STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Visual C++, 32-bit Edition, version 4.0.
MORE INFORMATION
Sample Code to Demonstrate Problem
/* Compiler Options: /c */class TestClass { public: void TestFunc(const int i) {}; void TestFunc(int i) {}; // Expecting C2579 }; |
Additional reference words: 2.00 2.10 8.0 8.00 8.0c 8.00c 9.0 9.00 9.1
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |