Commit 402dc50d authored by Robert Bradshaw's avatar Robert Bradshaw

Fix compiler crash for invalid C++ base classes.

parent cc6a2207
......@@ -25,6 +25,14 @@ Bugs fixed
* C++ class nesting was broken.
* Better checking for required nullary constructors for stack-allocated C++ instances.
* Remove module docstring in no-docstring mode.
* Fix specialization for varargs function signatures.
* Fix several compiler crashes.
Other changes
-------------
......
......@@ -1206,7 +1206,12 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
scope = None
if self.attributes is not None:
scope = CppClassScope(self.name, env, templates = self.templates)
base_class_types = [b.analyse(scope or env) for b in self.base_classes]
def base_ok(base_class):
if base_class.is_cpp_class or base_class.is_struct:
return True
else:
error(self.pos, "Base class '%s' not a struct or class." % base_class)
base_class_types = filter(base_ok, [b.analyse(scope or env) for b in self.base_classes])
if self.templates is None:
template_types = None
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment