Fix type lookup in the presence of using directives and using declarations
Fix some cases of type lookup failure via a combination of both using directives and
using declarations resulting in C++ code that did not compile as the generated type was
not fully qualified for use in the global namespace. Example below:
namespace Space5 {
namespace SubSpace5 {
namespace SubSubSpace5 {
struct F {};
}
}
using namespace SubSpace5;
using SubSubSpace5::F;
void func(SubSubSpace5::F f);
}
This commit is contained in:
parent
8bf81b8718
commit
bf98c5304f
6 changed files with 139 additions and 30 deletions
36
Examples/test-suite/namespace_chase.i
Normal file
36
Examples/test-suite/namespace_chase.i
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
%module namespace_chase
|
||||
|
||||
%inline %{
|
||||
namespace Space1A {
|
||||
struct Struct1A {};
|
||||
namespace Space1B {
|
||||
struct Struct1B {};
|
||||
namespace Space1C {
|
||||
struct Struct1C {};
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Space2A {
|
||||
using namespace Space1A;
|
||||
namespace Space2B {
|
||||
using namespace Space1B;
|
||||
namespace Space2C {
|
||||
using namespace Space1C;
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Space3 {
|
||||
using namespace Space2A;
|
||||
void sss3a(Space1A::Struct1A, Space1A::Space1B::Struct1B, Space1A::Space1B::Space1C::Struct1C) {}
|
||||
void sss3b(Struct1A, Space1B::Struct1B, Space1B::Space1C::Struct1C) {}
|
||||
// To fix: the last two parameters below fail and result in SWIGTYPE_ types instead of proxy classes
|
||||
void sss3c(Space2A::Struct1A, Space2A::Space1B::Struct1B, Space2A::Space1B::Space1C::Struct1C) {}
|
||||
}
|
||||
namespace Space4 {
|
||||
using namespace Space2A;
|
||||
using namespace Space2A::Space2B;
|
||||
using namespace Space2A::Space2B::Space2C;
|
||||
void sss4a(Struct1A, Struct1B, Space2C::Struct1C) {}
|
||||
void sss4b(Struct1A, Struct1B, Struct1C) {}
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue