Cannot allow subclassing if a destructor is private

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2011-07-19 19:49:04 +01:00
1 parent daffb90e2f
commit ac966d7dd2
1 file changed
+5 -1
+5 -1
View File
@@ -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