BUG: Native Expression Evaluator for Visual Studio .NET Cannot Resolve an Overloaded Function with Pointer Types as Parameters (318543)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2002)
  • Microsoft Visual C++ .NET (2003)

This article was previously published under Q318543

SYMPTOMS

The native expression evaluator in Visual Studio .NET can evaluate functions that take pointers as parameters. However, when you overload that function, you may receive the following error message:
CXX0039: Error: symbol is ambiguous

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. In Visual C++ .NET, create a new console application. To do this, open the New Project Wizard and then select Win32 application. In Application Settings, select Console application.
  2. Open the Projectname.cpp file of the project, and then add the following code:
    #include "stdafx.h"
    
    class class1{};
    class class2{};
    
    int func1(class1 *x){return 1;}
    int func1(class2 *x){return 2;}
    
    int func2(class1 *x){return 3;}
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	class1 *x = new class1();
    	class2 *y = new class2();
    
    	func1(x);		// doesn't work
    	func1(y);		// doesn't work
    
    	func2(x);		// works
    
    	return 0;
    }
    					
  3. Build the application.
  4. Set a breakpoint on the last statement ("return 0").
  5. To start the debugger, press F5. The debugger stops at the breakpoint.
  6. In the watch window, type func1(x) Result: You receive the error message in the "Symptoms" section of this article. If you type func2(x) you see that the appropriate value is displayed.

REFERENCES

For more information about expression evaluators, visit the following Microsoft Developer Network (MSDN) Web site: For more information about expressions in the Visual Studio .NET debugger, visit the following MSDN Web site:

Modification Type:MajorLast Reviewed:4/5/2006
Keywords:kbBug kbDebug kbpending KB318543