Browse Source

Fixed more declarations to define their members at global scope.

pull/232/head
triton 11 years ago
parent
commit
cf9df7330e
  1. 22
      tests/Basic/Basic.h
  2. 16
      tests/CSharpTemp/CSharpTemp.h

22
tests/Basic/Basic.h

@ -339,14 +339,17 @@ typedef unsigned long foo_t; @@ -339,14 +339,17 @@ typedef unsigned long foo_t;
typedef struct DLL_API SomeStruct
{
SomeStruct();
foo_t& operator[](int i) { return p; }
foo_t& operator[](int i);
// CSharp backend can't deal with a setter here
foo_t operator[](const char* name) { return p; }
foo_t operator[](const char* name);
foo_t p;
} SomeStruct;
SomeStruct::SomeStruct() : p(1) {}
foo_t& SomeStruct::operator[](int i) { return p; }
foo_t SomeStruct::operator[](const char* name) { return p; }
class DLL_API SomeClassExtendingTheStruct : public SomeStruct
{
};
@ -366,12 +369,15 @@ class DLL_API ClassWithOverloadedOperators @@ -366,12 +369,15 @@ class DLL_API ClassWithOverloadedOperators
public:
ClassWithOverloadedOperators();
operator char() { return 1; }
operator int() { return 2; }
operator short() { return 3; }
operator char();
operator int();
operator short();
};
ClassWithOverloadedOperators::ClassWithOverloadedOperators() {}
ClassWithOverloadedOperators::operator char() { return 1; }
ClassWithOverloadedOperators::operator int() { return 2; }
ClassWithOverloadedOperators::operator short() { return 3; }
// Tests global static function generation
DLL_API int Function()
@ -385,11 +391,13 @@ struct DLL_API TestProperties @@ -385,11 +391,13 @@ struct DLL_API TestProperties
TestProperties();
int Field;
int getFieldValue() { return Field; }
void setFieldValue(int Value) { Field = Value; }
int getFieldValue();
void setFieldValue(int Value);
};
TestProperties::TestProperties() : Field(0) {}
int TestProperties::getFieldValue() { return Field; }
void TestProperties::setFieldValue(int Value) { Field = Value; }
enum struct MyEnum { A, B, C };

16
tests/CSharpTemp/CSharpTemp.h

@ -27,6 +27,7 @@ public: @@ -27,6 +27,7 @@ public:
class DLL_API Bar : public Qux
{
public:
Bar();
int method();
const Foo& operator[](int i) const;
Foo& operator[](int i);
@ -41,9 +42,12 @@ private: @@ -41,9 +42,12 @@ private:
Foo m_foo;
};
Bar::Bar() {}
class DLL_API Baz : public Foo, public Bar
{
public:
Baz();
int takesQux(const Qux& qux);
Qux returnQux();
@ -52,6 +56,8 @@ public: @@ -52,6 +56,8 @@ public:
FunctionTypedef functionTypedef;
};
Baz::Baz() {}
struct QArrayData
{
};
@ -82,11 +88,14 @@ protected: @@ -82,11 +88,14 @@ protected:
class DLL_API Proprietor : public AbstractProprietor
{
public:
Proprietor();
virtual void setValue(int value);
virtual long prop();
};
Proprietor::Proprietor() {}
template <typename T>
class QFlags
{
@ -131,10 +140,13 @@ struct DLL_API TestDestructors @@ -131,10 +140,13 @@ struct DLL_API TestDestructors
{
static int Marker;
TestDestructors() { Marker = 0xf00d; }
~TestDestructors() { Marker = 0xcafe; }
TestDestructors();
~TestDestructors();
};
TestDestructors::TestDestructors() { Marker = 0xf00d; }
TestDestructors::~TestDestructors() { Marker = 0xcafe; }
class DLL_API TestCopyConstructorVal
{
public:

Loading…
Cancel
Save