diff options
Diffstat (limited to 'Examples/test-suite')
8 files changed, 45 insertions, 39 deletions
diff --git a/Examples/test-suite/errors/cpp_class_definition.i b/Examples/test-suite/errors/cpp_class_definition.i index 22d7c1521..d6842eef1 100644 --- a/Examples/test-suite/errors/cpp_class_definition.i +++ b/Examples/test-suite/errors/cpp_class_definition.i @@ -24,3 +24,17 @@ namespace Space2 { }; } +namespace Space2 { + struct B; +} + +struct ::Space2::B { + int val; + B() : val() {} +}; + +struct XX; +// g++: error: global qualification of class name is invalid before ‘{’ token +struct ::XX { + int vvv; +}; diff --git a/Examples/test-suite/errors/cpp_class_definition.stderr b/Examples/test-suite/errors/cpp_class_definition.stderr index 659e254c5..c467bcbcb 100644 --- a/Examples/test-suite/errors/cpp_class_definition.stderr +++ b/Examples/test-suite/errors/cpp_class_definition.stderr @@ -1,3 +1,5 @@ cpp_class_definition.i:11: Warning 302: Identifier 'L' redefined (ignored), cpp_class_definition.i:10: Warning 302: previous definition of 'L'. cpp_class_definition.i:22: Error: 'Space1::A' resolves to 'Space1::A' and was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'. +cpp_class_definition.i:31: Error: Using the unary scope operator :: in class definition '::Space2::B' is invalid. +cpp_class_definition.i:38: Error: Using the unary scope operator :: in class definition '::XX' is invalid. diff --git a/Examples/test-suite/errors/cpp_invalid_template.stderr b/Examples/test-suite/errors/cpp_invalid_template.stderr index f6bfaaf7d..f39464942 100644 --- a/Examples/test-suite/errors/cpp_invalid_template.stderr +++ b/Examples/test-suite/errors/cpp_invalid_template.stderr @@ -1,3 +1,2 @@ -cpp_invalid_template.i:3: Error: Undefined scope 'SSS' cpp_invalid_template.i:3: Error: Template 'SSS::AAA' undefined. cpp_invalid_template.i:9: Error: 'JJJ' is not defined as a template. (classforward) diff --git a/Examples/test-suite/errors/cpp_namespace_template_bad.i b/Examples/test-suite/errors/cpp_namespace_template_bad.i index f41918f8e..d8a33098e 100644 --- a/Examples/test-suite/errors/cpp_namespace_template_bad.i +++ b/Examples/test-suite/errors/cpp_namespace_template_bad.i @@ -9,6 +9,11 @@ namespace test { }; } +namespace test1 { + %template(maxchar) ::test::max<char>; + %template(vectorchar) ::test::vector<char>; +} + namespace test2 { using namespace test; %template(maxshort) max<short>; @@ -32,9 +37,18 @@ namespace test4 { %template(vectorInteger) vector<Integer>; } -using namespace test; namespace test5 { +// Empty namespace +} +template<typename T> struct GlobalVector { + void gook(T i) {} + void geeko(double d) {} + void geeky(int d) {} +}; +%template(GlobalVectorIntPtr) test5::GlobalVector<int *>; // should fail as GlobalVector is in global namespace + +using namespace test; +namespace test6 { %template(maxdouble) max<double>; %template(vectordouble) vector<double>; } - diff --git a/Examples/test-suite/errors/cpp_namespace_template_bad.stderr b/Examples/test-suite/errors/cpp_namespace_template_bad.stderr index 8ac072d74..d6ee15d5f 100644 --- a/Examples/test-suite/errors/cpp_namespace_template_bad.stderr +++ b/Examples/test-suite/errors/cpp_namespace_template_bad.stderr @@ -1,9 +1,11 @@ -cpp_namespace_template_bad.i:14: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test2' instead of within scope 'test'. -cpp_namespace_template_bad.i:15: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test2' instead of within scope 'test'. -cpp_namespace_template_bad.i:21: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test3' instead of within scope 'test'. -cpp_namespace_template_bad.i:22: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test3' instead of within scope 'test'. -cpp_namespace_template_bad.i:31: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test4' instead of within scope 'test'. -cpp_namespace_template_bad.i:32: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test4' instead of within scope 'test'. -cpp_namespace_template_bad.i:37: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test5' instead of within scope 'test'. -cpp_namespace_template_bad.i:37: Error: No matching function template 'max' found. -cpp_namespace_template_bad.i:38: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test5' instead of within scope 'test'. +cpp_namespace_template_bad.i:13: Error: '::test::max' resolves to 'test::max' and was incorrectly instantiated in scope 'test1' instead of within scope 'test'. +cpp_namespace_template_bad.i:14: Error: '::test::vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test1' instead of within scope 'test'. +cpp_namespace_template_bad.i:19: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test2' instead of within scope 'test'. +cpp_namespace_template_bad.i:20: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test2' instead of within scope 'test'. +cpp_namespace_template_bad.i:26: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test3' instead of within scope 'test'. +cpp_namespace_template_bad.i:27: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test3' instead of within scope 'test'. +cpp_namespace_template_bad.i:36: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test4' instead of within scope 'test'. +cpp_namespace_template_bad.i:37: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test4' instead of within scope 'test'. +cpp_namespace_template_bad.i:48: Error: Template 'test5::GlobalVector' undefined. +cpp_namespace_template_bad.i:52: Error: 'max' resolves to 'test::max' and was incorrectly instantiated in scope 'test6' instead of within scope 'test'. +cpp_namespace_template_bad.i:53: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test6' instead of within scope 'test'. diff --git a/Examples/test-suite/errors/cpp_nested_template.stderr b/Examples/test-suite/errors/cpp_nested_template.stderr index 363a260f6..5b107cad4 100644 --- a/Examples/test-suite/errors/cpp_nested_template.stderr +++ b/Examples/test-suite/errors/cpp_nested_template.stderr @@ -1,4 +1,2 @@ cpp_nested_template.i:9: Error: 'Temply' resolves to '::Temply' and was incorrectly instantiated in scope 'A' instead of within scope ''. -cpp_nested_template.i:9: Warning 324: Named nested template instantiations not supported. Processing as if no name was given to %template(). cpp_nested_template.i:18: Error: 'Temply' resolves to '::Temply' and was incorrectly instantiated in scope 'B' instead of within scope ''. -cpp_nested_template.i:18: Warning 324: Named nested template instantiations not supported. Processing as if no name was given to %template(). diff --git a/Examples/test-suite/namespace_class.i b/Examples/test-suite/namespace_class.i index cc9940d13..17670a4ac 100644 --- a/Examples/test-suite/namespace_class.i +++ b/Examples/test-suite/namespace_class.i @@ -155,10 +155,8 @@ namespace test %} -namespace test { - - %template(BooT_H) ::BooT<Hello>; -} +using test::Hello; +%template(BooT_H) ::BooT<Hello>; %template(BooT_i) ::BooT<int>; diff --git a/Examples/test-suite/template_partial_specialization.i b/Examples/test-suite/template_partial_specialization.i index fd7c73326..3452535a9 100644 --- a/Examples/test-suite/template_partial_specialization.i +++ b/Examples/test-suite/template_partial_specialization.i @@ -122,24 +122,3 @@ namespace S { namespace S { %template(X2) X<int *>; }; - -#if 0 -// TODO fix: -%inline %{ -namespace Space { -} -template<typename T> struct Vector { - void gook(T i) {} - void geeko(double d) {} - void geeky(int d) {} -}; -/* -template<typename T> struct Vector<T *> { -}; -*/ -%} - -%template(VectorIntPtr) Space::Vector<int *>; // should fail as Vector is in global namespace -// is this a regression - no fails in 1.3.40 too -// Note problem is removed by removing empty Space namespace!! -#endif |