mirror of https://github.com/swig/swig
Testcase of private nested class usage causing segfault
Needs fixing for C#/Java
This commit is contained in:
parent
19f202cc16
commit
df67907168
|
@ -84,6 +84,7 @@ CPP_TEST_BROKEN += \
|
|||
extend_variable \
|
||||
li_std_vector_ptr \
|
||||
li_boost_shared_ptr_template \
|
||||
nested_private \
|
||||
overload_complicated \
|
||||
template_default_pointer \
|
||||
template_expr \
|
||||
|
|
|
@ -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…
Reference in New Issue