Microsoft KB Archive/318543

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

Article ID: 318543

Article Last Modified on 4/5/2006

-

APPLIES TO


 * Microsoft Visual C++ .NET 2002 Standard Edition
 * Microsoft Visual C++ .NET 2003 Standard Edition

-



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.



Steps to Reproduce the Behavior
 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.  Open the .cpp file of the project, and then add the following code:
 * 1) include &quot;stdafx.h&quot;

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; }                    Build the application. Set a breakpoint on the last statement (&quot;return 0&quot;). To start the debugger, press F5. The debugger stops at the breakpoint. In the watch window, type func1(x) Result: You receive the error message in the &quot;Symptoms&quot; section of this article. If you type func2(x) you see that the appropriate value is displayed.</li></ol>

<div class="references_section">