From 672f88df5afce244e30055ca3b922b50f8b00731 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Fri, 3 Jul 2015 17:00:31 +0300 Subject: [PATCH] Fixed the multiple inheritance of nested types. Signed-off-by: Dimitar Dobrev --- src/Generator/Passes/MultipleInheritancePass.cs | 4 ++-- tests/CSharpTemp/CSharpTemp.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Generator/Passes/MultipleInheritancePass.cs b/src/Generator/Passes/MultipleInheritancePass.cs index b2945dcf..63753609 100644 --- a/src/Generator/Passes/MultipleInheritancePass.cs +++ b/src/Generator/Passes/MultipleInheritancePass.cs @@ -91,7 +91,7 @@ namespace CppSharp.Passes public override bool VisitClassDecl(Class @class) { - if (AlreadyVisited(@class)) + if (!base.VisitClassDecl(@class)) return false; //CheckNonVirtualInheritedFunctions(@class); @@ -105,7 +105,7 @@ namespace CppSharp.Passes var @interface = GetInterface(@class, @base, true); @class.Bases[i] = new BaseClassSpecifier { Type = new TagType(@interface) }; } - return base.VisitClassDecl(@class); + return true; } private Class GetInterface(Class @class, Class @base, bool addMembers = false) diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index 6706fafa..2afcec56 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -70,6 +70,10 @@ Bar::Bar() {} class DLL_API Baz : public Foo, public Bar { public: + class NestedBase1 {}; + class NestedBase2 {}; + class NestedDerived : public NestedBase1, public NestedBase2 {}; + Baz(); int takesQux(const Qux& qux);