diff --git a/cmd/genbindings/clang2il.go b/cmd/genbindings/clang2il.go index b6197809..1cd425fc 100644 --- a/cmd/genbindings/clang2il.go +++ b/cmd/genbindings/clang2il.go @@ -394,6 +394,10 @@ nextMethod: // an existing class instance mm.IsStatic = true + if !AllowCtor(ret.ClassName, mm) { + continue + } + ret.Ctors = append(ret.Ctors, mm) case "CXXDestructorDecl": diff --git a/cmd/genbindings/config-allowlist.go b/cmd/genbindings/config-allowlist.go index c39ff30b..4f65ab0a 100644 --- a/cmd/genbindings/config-allowlist.go +++ b/cmd/genbindings/config-allowlist.go @@ -321,6 +321,12 @@ func AllowMethod(className string, mm CppMethod) error { return nil // OK, allow } +func AllowCtor(className string, mm CppMethod) bool { + + // Default allow + return true +} + // AllowType controls whether to permit binding of a method, if a method uses // this type in its parameter list or return type. // Any type not permitted by AllowClass is also not permitted by this method.