Browse Source

Reverted the hack about filling the empty names of parameters explicitly for function types. Added tests for this regression and another one caused by the changed around the introduction of FunctionType.Arguments.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/127/head
Dimitar Dobrev 12 years ago
parent
commit
2b77361d89
  1. 8
      src/Generator/Passes/CleanInvalidDeclNamesPass.cs
  2. 2
      tests/Basic/Basic.cpp
  3. 6
      tests/Basic/Basic.cs
  4. 4
      tests/Basic/Basic.h

8
src/Generator/Passes/CleanInvalidDeclNamesPass.cs

@ -71,14 +71,6 @@ namespace CppSharp.Passes @@ -71,14 +71,6 @@ namespace CppSharp.Passes
return base.VisitFunctionDecl(function);
}
public override bool VisitFunctionType(FunctionType function, TypeQualifiers quals)
{
foreach (var arg in function.Parameters)
arg.Visit(this);
return base.VisitFunctionType(function, quals);
}
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
var @class = typedef.Namespace.FindClass(typedef.Name);

2
tests/Basic/Basic.cpp

@ -168,7 +168,7 @@ Bar indirectReturn() @@ -168,7 +168,7 @@ Bar indirectReturn()
return Bar();
}
int ImplementsAbstractFoo::pureFunction()
int ImplementsAbstractFoo::pureFunction(int i)
{
return 5;
}

6
tests/Basic/Basic.cs

@ -11,6 +11,12 @@ namespace CppSharp.Tests @@ -11,6 +11,12 @@ namespace CppSharp.Tests
public Basic(GeneratorKind kind)
: base("Basic", kind)
{
}
public override void SetupPasses(Driver driver)
{
driver.Options.GenerateAbstractImpls = true;
}
public override void Preprocess(Driver driver, ASTContext lib)

4
tests/Basic/Basic.h

@ -111,7 +111,7 @@ public: @@ -111,7 +111,7 @@ public:
class DLL_API AbstractFoo
{
public:
virtual int pureFunction() = 0;
virtual int pureFunction(int i) = 0;
virtual int pureFunction1() = 0;
virtual int pureFunction2() = 0;
typedef void (*QTextStreamFunction)(int &);
@ -120,7 +120,7 @@ public: @@ -120,7 +120,7 @@ public:
class DLL_API ImplementsAbstractFoo : public AbstractFoo
{
public:
virtual int pureFunction();
virtual int pureFunction(int i);
virtual int pureFunction1();
virtual int pureFunction2();
};

Loading…
Cancel
Save