From cf9df7330e3a8be02c0c0e99b78bd02a038c545d Mon Sep 17 00:00:00 2001 From: triton Date: Thu, 17 Apr 2014 17:45:55 +0100 Subject: [PATCH] Fixed more declarations to define their members at global scope. --- tests/Basic/Basic.h | 22 +++++++++++++++------- tests/CSharpTemp/CSharpTemp.h | 16 ++++++++++++++-- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 5519cf55..4336dca5 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -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 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 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 }; diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index f7365de4..a8d073e0 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -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: 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: FunctionTypedef functionTypedef; }; +Baz::Baz() {} + struct QArrayData { }; @@ -82,11 +88,14 @@ protected: class DLL_API Proprietor : public AbstractProprietor { public: + Proprietor(); virtual void setValue(int value); virtual long prop(); }; +Proprietor::Proprietor() {} + template class QFlags { @@ -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: