From 756086cd5022f9fdf1daa0d9267fe7c4ca7e0b1c Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 23 Nov 2024 19:34:05 +1300 Subject: [PATCH] genbindings: enforce AllowVirtualForClass at construction time --- cmd/genbindings/transformblocklist.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/genbindings/transformblocklist.go b/cmd/genbindings/transformblocklist.go index eb14acd5..7d9294a3 100644 --- a/cmd/genbindings/transformblocklist.go +++ b/cmd/genbindings/transformblocklist.go @@ -27,6 +27,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) { continue } + // If this class is abstract, but we return !AllowVirtualForClass, then + // delete its constructors + if c.Abstract && !AllowVirtualForClass(c.ClassName) { + c.Ctors = nil + } + // Keep parsed.Classes[j] = c j++