Merge branch 'master' into doxygen

Fix the usual conflicts in autodoc unit test due to fixing the
divergences in autodoc generation between builtin and default cases in
this branch.
This commit is contained in:
Vadim Zeitlin 2017-09-19 13:54:41 +02:00
commit db65ae5aea
371 changed files with 9815 additions and 3191 deletions

View file

@ -0,0 +1,6 @@
%module xxx
struct Funcs {};
short (Funcs::* *)(bool) = 0;
short (Funcs::* const*)(bool) = 0;

View file

@ -0,0 +1,2 @@
cpp_bad_global_memberptr.i:5: Error: Missing symbol name for global declaration
cpp_bad_global_memberptr.i:6: Error: Missing symbol name for global declaration

View file

@ -0,0 +1,26 @@
%module xxx
// This should error but doesn't
#if 0
namespace OtherSpace {
struct L;
}
namespace Space11 {
namespace SubSpace11 {
using OtherSpace::L;
struct L {
void ll();
};
}
}
#endif
namespace Space1 {
struct A;
}
namespace Space2 {
struct Space1::A {
void x();
};
}

View file

@ -0,0 +1 @@
cpp_class_definition.i:22: Error: 'Space1::A' resolves to 'Space1::A' and was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.

View file

@ -0,0 +1,43 @@
%module cpp_invalid_qualifiers
// Constructors, destructors and static methods cannot have qualifiers
struct A {
~A() const;
};
struct B {
virtual ~B() const;
};
struct C {
~C() &;
};
struct D {
virtual ~D() &;
};
struct E {
~E() &&;
};
struct F {
virtual ~F() &&;
};
struct J {
J() const;
J(int) const;
};
struct K {
K() &;
K(int) &;
};
struct L {
L() &&;
L(int) &&;
};
struct M {
static void m1() const;
static void m2() &;
thread_local static void m3() &&;
static auto m4() const -> int;
static auto m5() & -> int;
static auto m6() && -> int;
};

View file

@ -0,0 +1,20 @@
cpp_invalid_qualifiers.i:5: Error: Destructor ~A() const cannot have a qualifier.
cpp_invalid_qualifiers.i:8: Error: Destructor ~B() const cannot have a qualifier.
cpp_invalid_qualifiers.i:11: Error: Destructor ~C() & cannot have a qualifier.
cpp_invalid_qualifiers.i:14: Error: Destructor ~D() & cannot have a qualifier.
cpp_invalid_qualifiers.i:17: Error: Destructor ~E() && cannot have a qualifier.
cpp_invalid_qualifiers.i:20: Error: Destructor ~F() && cannot have a qualifier.
cpp_invalid_qualifiers.i:24: Error: Constructor cannot have a qualifier.
cpp_invalid_qualifiers.i:25: Error: Constructor cannot have a qualifier.
cpp_invalid_qualifiers.i:28: Error: Constructor cannot have a qualifier.
cpp_invalid_qualifiers.i:29: Error: Constructor cannot have a qualifier.
cpp_invalid_qualifiers.i:32: Error: Constructor cannot have a qualifier.
cpp_invalid_qualifiers.i:33: Error: Constructor cannot have a qualifier.
cpp_invalid_qualifiers.i:37: Error: Static function m1() const cannot have a qualifier.
cpp_invalid_qualifiers.i:38: Error: Static function m2() & cannot have a qualifier.
cpp_invalid_qualifiers.i:39: Error: Static function m3() && cannot have a qualifier.
cpp_invalid_qualifiers.i:39: Warning 405: Method with rvalue ref-qualifier m3() && ignored.
cpp_invalid_qualifiers.i:40: Error: Static function m4() const cannot have a qualifier.
cpp_invalid_qualifiers.i:41: Error: Static function m5() & cannot have a qualifier.
cpp_invalid_qualifiers.i:42: Error: Static function m6() && cannot have a qualifier.
cpp_invalid_qualifiers.i:42: Warning 405: Method with rvalue ref-qualifier m6() && ignored.

View file

@ -0,0 +1,9 @@
%module cpp_invalid_scope
%template(abc) SSS::AAA<int>;
namespace UUU {
struct JJJ;
}
%template(xxx) UUU::JJJ<int>;

View file

@ -0,0 +1,3 @@
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)

View file

@ -0,0 +1,40 @@
%module namespace_template
namespace test {
template<typename T> T max(T a, T b) { return (a > b) ? a : b; }
template<typename T> class vector {
public:
vector() { }
~vector() { }
};
}
namespace test2 {
using namespace test;
%template(maxshort) max<short>;
%template(vectorshort) vector<short>;
}
namespace test3 {
using test::max;
using test::vector;
%template(maxlong) max<long>;
%template(vectorlong) vector<long>;
}
namespace test4 {
using namespace test;
typedef int Integer;
}
namespace test4 {
%template(maxInteger) max<Integer>;
%template(vectorInteger) vector<Integer>;
}
using namespace test;
namespace test5 {
%template(maxdouble) max<double>;
%template(vectordouble) vector<double>;
}

View file

@ -0,0 +1,9 @@
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: Template 'max' undefined.
cpp_namespace_template_bad.i:38: Error: 'vector' resolves to 'test::vector' and was incorrectly instantiated in scope 'test5' instead of within scope 'test'.

View file

@ -1,2 +1,4 @@
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().

View file

@ -0,0 +1,4 @@
%module xxx
%feature("docstring") func2 R"ABC(Calculate :math:`D^\nu \rho(x)`.)AB";
void func2(double* foo, int bar, char** baz);

View file

@ -0,0 +1,2 @@
cpp_raw_string_termination.i:3: Error: Unterminated raw string, started with R"ABC( is not terminated by )ABC"
cpp_raw_string_termination.i:3: Error: Syntax error in input(1).

View file

@ -0,0 +1,28 @@
%module cpp_refqualifier
%ignore Host::h_ignored;
%ignore Host::i_ignored() &&;
%ignore Host::j_ignored() const &&;
class Host {
public:
void h1() &;
void h2() const &;
void h3() &&;
void h4() const &&;
void h() &;
void h() const &;
void h() &&;
void h() const &&;
void h_ignored() &&;
void i_ignored() &&;
void i_ignored() &&;
};
%feature("ignore", "0") Unignore::k_unignored() const &&;
struct Unignore {
void k_unignored() const &&;
};

View file

@ -0,0 +1,6 @@
cpp_refqualifier.i:11: Warning 405: Method with rvalue ref-qualifier h3() && ignored.
cpp_refqualifier.i:12: Warning 405: Method with rvalue ref-qualifier h4() const && ignored.
cpp_refqualifier.i:16: Warning 405: Method with rvalue ref-qualifier h() && ignored.
cpp_refqualifier.i:17: Warning 405: Method with rvalue ref-qualifier h() const && ignored.
cpp_refqualifier.i:15: Warning 512: Overloaded method Host::h() const & ignored,
cpp_refqualifier.i:14: Warning 512: using non-const method Host::h() & instead.

View file

@ -0,0 +1,57 @@
%module xxx
namespace std {
template<typename T> class vector {};
}
struct S1 {};
struct S2 {};
struct S3 {};
struct S4 {};
struct S5 {};
struct S6 {};
struct S7 {};
// valid
namespace std {
%template(vi1) vector<S1>;
template class vector<S1>;
}
// valid
using namespace std;
%template(vi2) vector<S2>;
template class vector<S2>;
// valid
using std::vector;
%template(vi3) vector<S3>;
template class vector<S3>;
// ill-formed
namespace unrelated {
using std::vector;
%template(vi4) vector<S4>;
template class vector<S4>;
}
// ill-formed
namespace unrelated {
using namespace std;
%template(vi5) vector<S5>;
template class vector<S5>;
}
// ill-formed
namespace unrelated {
namespace std {
%template(vi6) vector<S6>;
template class vector<S6>;
}
}
// ill-formed
namespace unrelated {
%template(vi7) std::vector<S7>;
template class std::vector<S7>;
}

View file

@ -0,0 +1,11 @@
cpp_template_scope.i:18: Warning 320: Explicit template instantiation ignored.
cpp_template_scope.i:24: Warning 320: Explicit template instantiation ignored.
cpp_template_scope.i:29: Warning 320: Explicit template instantiation ignored.
cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
cpp_template_scope.i:35: Warning 320: Explicit template instantiation ignored.
cpp_template_scope.i:41: Error: 'vector' resolves to 'std::vector' and was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
cpp_template_scope.i:42: Warning 320: Explicit template instantiation ignored.
cpp_template_scope.i:48: Error: 'vector' resolves to 'std::vector' and was incorrectly instantiated in scope 'unrelated::std' instead of within scope 'std'.
cpp_template_scope.i:49: Warning 320: Explicit template instantiation ignored.
cpp_template_scope.i:55: Error: 'std::vector' resolves to 'std::vector' and was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
cpp_template_scope.i:56: Warning 320: Explicit template instantiation ignored.