Testcase of private nested class usage causing segfault

Needs fixing for C#/Java
This commit is contained in:
William S Fulton 2013-12-02 07:06:29 +00:00
parent 19f202cc16
commit df67907168
2 changed files with 33 additions and 0 deletions

View File

@ -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 \

View 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;
}
%}