Testcase of private nested class usage causing segfault
Needs fixing for C#/Java
This commit is contained in:
parent
19f202cc16
commit
df67907168
2 changed files with 33 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ CPP_TEST_BROKEN += \
|
||||||
extend_variable \
|
extend_variable \
|
||||||
li_std_vector_ptr \
|
li_std_vector_ptr \
|
||||||
li_boost_shared_ptr_template \
|
li_boost_shared_ptr_template \
|
||||||
|
nested_private \
|
||||||
overload_complicated \
|
overload_complicated \
|
||||||
template_default_pointer \
|
template_default_pointer \
|
||||||
template_expr \
|
template_expr \
|
||||||
|
|
|
||||||
32
Examples/test-suite/nested_private.i
Normal file
32
Examples/test-suite/nested_private.i
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
%module nested_private
|
||||||
|
|
||||||
|
// segfault due to private nested class usage
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
#include <string>
|
||||||
|
class MotorCar {
|
||||||
|
|
||||||
|
struct DesignOpinion {
|
||||||
|
std::string reason;
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
struct WindScreen {
|
||||||
|
WindScreen(bool opaque) : opaque(opaque) {}
|
||||||
|
DesignOpinion Opinion();
|
||||||
|
private:
|
||||||
|
bool opaque;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string WindScreenOpinion() {
|
||||||
|
return MotorCar::WindScreen(true).Opinion().reason;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
MotorCar::DesignOpinion MotorCar::WindScreen::Opinion() {
|
||||||
|
DesignOpinion opinion;
|
||||||
|
opinion.reason = !opaque ? "great design" : "you can't see out the windscreen";
|
||||||
|
return opinion;
|
||||||
|
}
|
||||||
|
|
||||||
|
%}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue