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