Cannot allow subclassing if a destructor is private
This commit is contained in:
1 parent
daffb90e2f
commit
ac966d7dd2
1 file changed
+5
-1
@@ -633,7 +633,11 @@ class CppClass(object):
|
||||
else:
|
||||
if any([p.allow_subclassing for p in self.bases]) and not allow_subclassing:
|
||||
raise ValueError("Cannot disable subclassing if a parent class allows it")
|
||||
self.allow_subclassing = allow_subclassing
|
||||
else:
|
||||
self.allow_subclassing = allow_subclassing
|
||||
|
||||
if self.destructor_visibility in ['public', 'protected']:
|
||||
self.allow_subclassing = False
|
||||
|
||||
self.typeid_map_name = None
|
||||
|
||||
|
||||
Reference in new issue
Block a user