Nested class improvements - Fixed inconsistency in handling C++ nested classes - sometimes they were treated as forward declarations, other times as if C nested struct was parsed. Added the nestedworkaround feature for C++ nested class handling. Document improved nested class handling. Numerous C and C++ nested struct/class/union test cases added.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11734 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a0ff0a86d0
commit
ebed6508e4
12 changed files with 300 additions and 82 deletions
|
|
@ -4,52 +4,94 @@
|
|||
|
||||
%inline %{
|
||||
struct Outer {
|
||||
typedef int Integer;
|
||||
///////////////////////////////////////////
|
||||
struct InnerStruct1 {
|
||||
int x;
|
||||
Integer x;
|
||||
};
|
||||
|
||||
class InnerClass1 {
|
||||
public:
|
||||
int x;
|
||||
Integer x;
|
||||
};
|
||||
|
||||
union InnerUnion1 {
|
||||
int x;
|
||||
Integer x;
|
||||
double y;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////
|
||||
class {
|
||||
public:
|
||||
int a;
|
||||
Integer a;
|
||||
};
|
||||
|
||||
struct {
|
||||
int b;
|
||||
Integer b;
|
||||
};
|
||||
|
||||
union {
|
||||
int c;
|
||||
Integer c;
|
||||
double d;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////
|
||||
class InnerClass2 {
|
||||
public:
|
||||
int x;
|
||||
Integer x;
|
||||
} InnerClass2Name;
|
||||
|
||||
struct InnerStruct2 {
|
||||
int x;
|
||||
Integer x;
|
||||
} InnerStruct2Name;
|
||||
|
||||
union InnerUnion2 {
|
||||
int x;
|
||||
Integer x;
|
||||
double y;
|
||||
} InnerUnion2Name;
|
||||
|
||||
///////////////////////////////////////////
|
||||
class {
|
||||
public:
|
||||
Integer x;
|
||||
} InnerClass3Name;
|
||||
|
||||
struct {
|
||||
Integer x;
|
||||
} InnerStruct3Name;
|
||||
|
||||
union {
|
||||
Integer x;
|
||||
double y;
|
||||
} InnerUnion3Name;
|
||||
|
||||
///////////////////////////////////////////
|
||||
typedef class {
|
||||
public:
|
||||
Integer x;
|
||||
} InnerClass4;
|
||||
|
||||
typedef struct {
|
||||
Integer x;
|
||||
} InnerStruct4;
|
||||
|
||||
typedef union {
|
||||
Integer x;
|
||||
double y;
|
||||
} InnerUnion4;
|
||||
|
||||
// bug #909387 - inner declared types are treated as forward declarations
|
||||
InnerStruct1* getInnerStruct1() { return 0; }
|
||||
InnerClass1* getInnerClass1() { return 0; }
|
||||
InnerUnion1* getInnerUnion1() { return 0; }
|
||||
|
||||
InnerStruct2* getInnerStruct2() { return 0; }
|
||||
InnerClass2* getInnerClass2() { return 0; }
|
||||
InnerUnion2* getInnerUnion2() { return 0; }
|
||||
|
||||
InnerStruct4* getInnerStruct4() { return 0; }
|
||||
InnerClass4* getInnerClass4() { return 0; }
|
||||
InnerUnion4* getInnerUnion4() { return 0; }
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue