Permalink
Browse files

Fixed the generated C# when a protected constructor has a parameter w…

…ith a protected type.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information...
ddobrev committed Jul 26, 2017
1 parent 081b111 commit 2002377f27a182476311a070390f1d5e49316ab1
Showing with 14 additions and 2 deletions.
  1. +4 −2 src/Generator/Passes/ConstructorToConversionOperatorPass.cs
  2. +10 −0 tests/Common/Common.h
@@ -12,8 +12,10 @@ public class ConstructorToConversionOperatorPass : TranslationUnitPass
{
public override bool VisitMethodDecl(Method method)
{
if (AlreadyVisited(method) || !method.IsGenerated || !method.IsConstructor ||
method.IsCopyConstructor)
if (AlreadyVisited(method) || !method.IsGenerated || !method.IsConstructor
|| method.IsCopyConstructor
// conversion operators can only be public
|| method.Access != AccessSpecifier.Public)
return false;
var @params = method.Parameters.Where(p => p.Kind == ParameterKind.Regular).ToList();
@@ -1312,3 +1312,13 @@ class DLL_API HasVirtualFunctionWithBoolParams
~HasVirtualFunctionWithBoolParams();
virtual bool virtualFunctionWithBoolParamAndReturnsBool(bool testBool);
};
class HasProtectedCtorWithProtectedParam
{
protected:
enum ProtectedEnum
{
Member
};
HasProtectedCtorWithProtectedParam(ProtectedEnum protectedParam);
};

0 comments on commit 2002377

Please sign in to comment.