Added testcase cpp0x_constructors for delegating constructors and constructor inheritance.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matevz Jekovec 2009-08-11 15:20:38 +00:00
commit 41a565dd5f
2 changed files with 36 additions and 5 deletions

View file

@ -413,13 +413,14 @@ CPP0X_TEST_CASES = \
cpp0x_alternate_function_syntax \
cpp0x_userdefined_literals \
cpp0x_decltype
# cpp0x_hash_types # not fully implemented yet
# cpp0x_hash_types # not fully implemented yet
# cpp0x_constructors # not supported by any compiler yet
# cpp0x_lambda_functions # not supported by GCC or MSVC yet
# cpp0x_null_pointer_constant # not supported by any compilers yet
# cpp0x_unrestricted_unions # not supported by any compilers yet
# cpp0x_null_pointer_constant # not supported by any compiler yet
# cpp0x_unrestricted_unions # not supported by any compiler yet
# cpp0x_smart_pointers # not supported by standard library yet
# cpp0x_constexpr # not supported by any compilers yet
# cpp0x_thread_local # not supported by any compilers yet
# cpp0x_constexpr # not supported by any compiler yet
# cpp0x_thread_local # not supported by any compiler yet
# Broken C++0x test cases.
CPP0X_TEST_BROKEN =

View file

@ -0,0 +1,30 @@
/* This test checks whether Swig correctly parses the new delegating
constructors and constructor inheritance.
*/
%module cpp0x_constructors
%inline %{
class BaseClass {
private:
int _val;
public:
BaseClass(int iValue) { _val = iValue; }
};
class DerivedClass: public BaseClass {
public:
using BaseClass::BaseClass; // Adds DerivedClass(int) constructor
};
class A {
public:
int a;
int b;
int c;
A() : A( 10 ) {}
A(int aa) : A(aa, 20) {}
A(int aa, int bb) : A(aa, bb, 30) {}
A(int aa, int bb, int cc) { a=aa; b=bb; c=cc; }
};
%}