ClangSharp
ClangSharp copied to clipboard
DivideByZeroException in GetTypeSize
public override Task NestedDeclarationTest()
{
var inputContents = @"struct CustomNativeNew {};
struct CustomNativeNewNested
{
CustomNativeNew Nested;
};
";
var expectedOutputContents = @"namespace ClangSharp.Test
{
public partial struct CustomNativeNew
{
}
public partial struct CustomNativeNewNested
{
public CustomNativeNew Nested;
}
}
";
return ValidateGeneratedCSharpLatestWindowsBindingsAsync(inputContents, expectedOutputContents);
}
Found after fixing #223 (actually, first uncovered when working on next-generation SharpGen based on ClangSharp).
This likely means that an unsupported type declaration was also encountered and the size/alignment for it was not changed from the default.
The else block that adds the diagnostic should likely set the alignment to the default alignment (4/8
) if nothing else has been set to avoid this issue.
This one isn't repro'ing anymore. I believe I fixed it a while back when I adjusted the handling to use -1
as the default.