Template private assignment testcase
This is broken and needs fixing at some point. Problem reported by Pierre-Henri Wuillemin on swig-devel mailing list.
This commit is contained in:
parent
0c1058511b
commit
e702093c70
2 changed files with 25 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ CPP_TEST_BROKEN += \
|
||||||
nested_private \
|
nested_private \
|
||||||
overload_complicated \
|
overload_complicated \
|
||||||
template_default_pointer \
|
template_default_pointer \
|
||||||
|
template_private_assignment \
|
||||||
template_expr \
|
template_expr \
|
||||||
$(CPP11_TEST_BROKEN)
|
$(CPP11_TEST_BROKEN)
|
||||||
|
|
||||||
|
|
|
||||||
24
Examples/test-suite/template_private_assignment.i
Normal file
24
Examples/test-suite/template_private_assignment.i
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
%module template_private_assignment
|
||||||
|
|
||||||
|
/*
|
||||||
|
swig-devel mailing list report problem explained 2014-01-07
|
||||||
|
A setter for the global variable deleted_bits is generated because there is no template
|
||||||
|
instantiation for the template and hence SWIG does not find the private assignment operator.
|
||||||
|
SwigValueWrapper is probably on by default for templates that are not instantiated for the
|
||||||
|
same reason.
|
||||||
|
The solution is probably to add an instantiation of the template as soon as one is parsed,
|
||||||
|
that is an implicit empty %template().
|
||||||
|
*/
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
template<typename T, typename U> struct DeletedBits {
|
||||||
|
// DeletedBits& operator=(const DeletedBits&) = delete;
|
||||||
|
private:
|
||||||
|
DeletedBits& operator=(const DeletedBits&);
|
||||||
|
};
|
||||||
|
|
||||||
|
DeletedBits<int, double> deleted_bits;
|
||||||
|
%}
|
||||||
|
|
||||||
|
// This works around the problem
|
||||||
|
//%template() DeletedBits<int, double>;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue