CppClassRefParameter should check if class is constructible only when the parameter has a default value.

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-06-30 15:24:03 +01:00
1 parent 2cff12d6ad
commit fe261114bc
1 file changed
+1 -2
+1 -2
View File
@@ -1717,7 +1717,6 @@ class CppClassRefParameter(CppClassParameterBase):
assert isinstance(wrapper, ForwardWrapperBase)
assert isinstance(self.cpp_class, CppClass)
if self.direction == Parameter.DIRECTION_IN:
if self.take_value_from_python_self:
self.py_name = 'self'
@@ -1726,8 +1725,8 @@ class CppClassRefParameter(CppClassParameterBase):
else:
implicit_conversion_sources = self.cpp_class.get_all_implicit_conversions()
if not (implicit_conversion_sources and self.is_const):
self.cpp_class.get_construct_name() # raises an exception if the class cannot be constructed
if self.default_value is not None:
self.cpp_class.get_construct_name() # raises an exception if the class cannot be constructed
self.py_name = wrapper.declarations.declare_variable(
self.cpp_class.pystruct+'*', self.name, 'NULL')
wrapper.parse_params.add_parameter(