From 7e8f451e4865cf3f28ff1a23eb7d7ff933bd15e1 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 19 Jan 2025 17:06:58 +1300 Subject: [PATCH] genbindings: fix checking private methods of wrong class --- cmd/genbindings/intermediate.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/genbindings/intermediate.go b/cmd/genbindings/intermediate.go index 79543a20..af5c569b 100644 --- a/cmd/genbindings/intermediate.go +++ b/cmd/genbindings/intermediate.go @@ -449,6 +449,10 @@ func (c *CppClass) VirtualMethods() []CppMethod { retNames[m.CppCallTarget()] = struct{}{} } + for _, privMethod := range c.PrivateMethods { + block[privMethod] = struct{}{} + } + // Go will automatically allow virtual overrides for the base type because // the parent struct is nested, but the resulting functions will not work // because the C ABI dynamic_cast<> will fail for the base type. @@ -498,7 +502,7 @@ func (c *CppClass) VirtualMethods() []CppMethod { // Append this parent's private-virtuals to blocklist so that we // do not consider them for grandparent classes - for _, privMethod := range c.PrivateMethods { + for _, privMethod := range cinfo.Class.PrivateMethods { block[privMethod] = struct{}{} } }