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:
William S Fulton 2017-08-12 10:11:38 +01:00
commit bf98c5304f
6 changed files with 139 additions and 30 deletions

View file

@ -0,0 +1,26 @@
import namespace_chase.*;
public class namespace_chase_runme {
static {
try {
System.loadLibrary("namespace_chase");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
Struct1A s1a = new Struct1A();
Struct1B s1b = new Struct1B();
Struct1C s1c = new Struct1C();
namespace_chase.sss3a(s1a, s1b, s1c);
namespace_chase.sss3b(s1a, s1b, s1c);
// needs fixing
// namespace_chase.sss3c(s1a, s1b, s1c);
}
}