diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2016-06-26 00:33:19 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2016-06-26 00:33:19 +0100 |
commit | b24e970a28619d33c3ad4e2454ec3f2b4b5fa001 (patch) | |
tree | 8791f0d5882998384391c34965a2320aeac4f125 | |
parent | 2da7e066b331d2aff98ef8f20d151bfef67497c7 (diff) | |
parent | 4aa86c66472904ec4ed7d983283d1f17951bcff5 (diff) | |
download | swig-b24e970a28619d33c3ad4e2454ec3f2b4b5fa001.tar.gz |
Merge branch 'wkalinin-nested-ignore-fix'
* wkalinin-nested-ignore-fix:
renamed test module, in accordance with other tests
function body fixed
added foo() definition to satisfy some test linking fails
func() renamed to foo() for 'go'
fixed test-suite/nested_ignore.i
test for #662
fix for nested ignored types
Closes #662
-rw-r--r-- | Examples/test-suite/common.mk | 1 | ||||
-rw-r--r-- | Examples/test-suite/nested_ignore.i | 24 | ||||
-rw-r--r-- | Source/Modules/csharp.cxx | 8 | ||||
-rw-r--r-- | Source/Modules/java.cxx | 12 |
4 files changed, 39 insertions, 6 deletions
diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index a6747a080..1658e509b 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -308,6 +308,7 @@ CPP_TEST_CASES += \ nested_class \ nested_directors \ nested_comment \ + nested_ignore \ nested_scope \ nested_template_base \ nested_workaround \ diff --git a/Examples/test-suite/nested_ignore.i b/Examples/test-suite/nested_ignore.i new file mode 100644 index 000000000..e271eca7d --- /dev/null +++ b/Examples/test-suite/nested_ignore.i @@ -0,0 +1,24 @@ +%module nested_ignore +%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) B::C::D; + +%rename($ignore) B::C; + +%inline %{ +namespace B { + class C { + public: + struct D { + }; + }; + + class E { + public: + typedef C::D D; + }; + + struct F + { + const E::D foo(){ return E::D(); } + }; +} +%} diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index 12a502586..01fd5435b 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -188,8 +188,12 @@ public: String *symname = Copy(Getattr(n, "sym:name")); if (symname && !GetFlag(n, "feature:flatnested")) { for (Node *outer_class = Getattr(n, "nested:outer"); outer_class; outer_class = Getattr(outer_class, "nested:outer")) { - Push(symname, "."); - Push(symname, Getattr(outer_class, "sym:name")); + if (String* name = Getattr(outer_class, "sym:name")) { + Push(symname, "."); + Push(symname, name); + } + else + return NULL; } } if (nspace) { diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index b7a5ebbfe..eb809ff59 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -210,10 +210,14 @@ public: String *nspace = Getattr(n, "sym:nspace"); String *symname = Copy(Getattr(n, "sym:name")); if (symname && !GetFlag(n, "feature:flatnested")) { - for (Node *outer_class = Getattr(n, "nested:outer"); outer_class; outer_class = Getattr(outer_class, "nested:outer")) { - Push(symname, jnidescriptor ? "$" : "."); - Push(symname, Getattr(outer_class, "sym:name")); - } + for (Node *outer_class = Getattr(n, "nested:outer"); outer_class; outer_class = Getattr(outer_class, "nested:outer")) { + if (String* name = Getattr(outer_class, "sym:name")) { + Push(symname, jnidescriptor ? "$" : "."); + Push(symname, name); + } + else + return NULL; + } } if (nspace) { if (package && !jnidescriptor) |