Browse Source

Added a test about the type def - to a function pointer - incorrectly resolved to void*.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/72/head
Dimitar Dobrev 12 years ago
parent
commit
2091d71242
  1. 10
      src/Generator/Passes/CheckAmbiguousFunctions.cs
  2. 3
      tests/CSharpTemp/CSharpTemp.h

10
src/Generator/Passes/CheckAmbiguousFunctions.cs

@ -35,6 +35,16 @@ namespace CppSharp.Passes @@ -35,6 +35,16 @@ namespace CppSharp.Passes
foreach (var overload in overloads)
{
if (function.OperatorKind == CXXOperatorKind.Conversion)
{
if (function != overload &&
function.OriginalReturnType == overload.OriginalReturnType)
{
overload.ExplicityIgnored = true;
function.IsAmbiguous = true;
}
continue;
}
if (overload == function) continue;
if (overload.Ignore) continue;

3
tests/CSharpTemp/CSharpTemp.h

@ -41,4 +41,7 @@ public: @@ -41,4 +41,7 @@ public:
int takesQux(const Qux& qux);
Qux returnQux();
operator int() const;
typedef void *Baz::*FunctionPointerResolvedAsVoidStar;
operator FunctionPointerResolvedAsVoidStar() const { return 0; }
};

Loading…
Cancel
Save