diff --git a/src/Generator/Passes/CheckIgnoredDecls.cs b/src/Generator/Passes/CheckIgnoredDecls.cs index 25e76cdb..037f08a5 100644 --- a/src/Generator/Passes/CheckIgnoredDecls.cs +++ b/src/Generator/Passes/CheckIgnoredDecls.cs @@ -341,18 +341,6 @@ namespace CppSharp.Passes return true; } - Class @class; - var arrayType = type as ArrayType; - PrimitiveType primitive; - if (arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant && - !arrayType.Type.IsPrimitiveType(out primitive) && - !arrayType.Type.Desugar().IsPointerToPrimitiveType() && - !(arrayType.Type.Desugar().TryGetClass(out @class) && @class.IsRefType)) - { - msg = "unsupported"; - return true; - } - msg = null; return false; } diff --git a/src/Generator/Types/Types.cs b/src/Generator/Types/Types.cs index 0bd40b49..1000198d 100644 --- a/src/Generator/Types/Types.cs +++ b/src/Generator/Types/Types.cs @@ -109,6 +109,33 @@ namespace CppSharp Ignore(); return base.VisitTemplateSpecializationType(template, quals); } + + public override bool VisitArrayType(ArrayType array, TypeQualifiers quals) + { + TypeMap typeMap; + if (TypeMapDatabase.FindTypeMap(array, out typeMap) && typeMap.IsIgnored) + { + Ignore(); + return false; + } + + if (array.SizeType != ArrayType.ArraySize.Constant) + return true; + + var arrayElemType = array.Type.Desugar(); + + Class @class; + if (arrayElemType.TryGetClass(out @class) && @class.IsRefType) + return true; + + PrimitiveType primitive; + if (arrayElemType.IsPrimitiveType(out primitive) || + arrayElemType.IsPointerToPrimitiveType()) + return true; + + Ignore(); + return false; + } } }