mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
genbindings/clang: implicit ctors/dtors always have public visibility
This commit is contained in:
parent
03a47e4da4
commit
fc62d963ea
@ -233,7 +233,12 @@ nextMethod:
|
|||||||
// These seem to have no useful content
|
// These seem to have no useful content
|
||||||
|
|
||||||
case "CXXConstructorDecl":
|
case "CXXConstructorDecl":
|
||||||
if !visibility {
|
|
||||||
|
if isImplicit, ok := node["isImplicit"].(bool); ok && isImplicit {
|
||||||
|
// This is an implicit ctor. Therefore the class is constructable
|
||||||
|
// even if we're currently in a `private:` block.
|
||||||
|
|
||||||
|
} else if !visibility {
|
||||||
continue // Skip private/protected
|
continue // Skip private/protected
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,6 +293,13 @@ nextMethod:
|
|||||||
// However if this destructor is private or deleted, we should
|
// However if this destructor is private or deleted, we should
|
||||||
// not bind it
|
// not bind it
|
||||||
|
|
||||||
|
if isImplicit, ok := node["isImplicit"].(bool); ok && isImplicit {
|
||||||
|
// This is an implicit dtor. Therefore the class is deleteable
|
||||||
|
// even if we're currently in a `private:` block.
|
||||||
|
ret.CanDelete = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if !visibility {
|
if !visibility {
|
||||||
ret.CanDelete = false
|
ret.CanDelete = false
|
||||||
continue
|
continue
|
||||||
|
@ -385,7 +385,7 @@ import "C"
|
|||||||
// Construct our Go type based on this inner CABI type
|
// Construct our Go type based on this inner CABI type
|
||||||
shouldReturn = "ret := "
|
shouldReturn = "ret := "
|
||||||
|
|
||||||
if m.ReturnType.Pointer || m.ReturnType.ParameterType == "QSize" { // FIXME QSize has a deleted destructor, so we can't delete our heap copy with a finalizer(!!)
|
if m.ReturnType.Pointer {
|
||||||
gfs.imports["unsafe"] = struct{}{}
|
gfs.imports["unsafe"] = struct{}{}
|
||||||
afterword = "return new" + m.ReturnType.ParameterType + "_U(unsafe.Pointer(ret))"
|
afterword = "return new" + m.ReturnType.ParameterType + "_U(unsafe.Pointer(ret))"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user