Browse Source

Fixed more declarations to define their members at global scope.

pull/232/head
triton 11 years ago
parent
commit
36230fc667
  1. 24
      tests/Basic/Basic.h

24
tests/Basic/Basic.h

@ -205,11 +205,13 @@ DLL_API int test(basic& s);
// Tests the MoveOperatorToClassPass // Tests the MoveOperatorToClassPass
struct DLL_API TestMoveOperatorToClass struct DLL_API TestMoveOperatorToClass
{ {
TestMoveOperatorToClass() {} TestMoveOperatorToClass();
int A; int A;
int B; int B;
}; };
TestMoveOperatorToClass::TestMoveOperatorToClass() {}
DLL_API int operator *(TestMoveOperatorToClass klass, int b) DLL_API int operator *(TestMoveOperatorToClass klass, int b)
{ {
return klass.A * b; return klass.A * b;
@ -284,12 +286,15 @@ struct DLL_API TestFinalizers
// Tests static classes // Tests static classes
struct DLL_API TestStaticClass struct DLL_API TestStaticClass
{ {
static int Add(int a, int b) { return a + b; } static int Add(int a, int b);
private: private:
TestStaticClass(); TestStaticClass();
}; };
int TestStaticClass::Add(int a, int b) { return a + b; }
class HasIgnoredField class HasIgnoredField
{ {
Base<Derived> fieldOfIgnoredType; Base<Derived> fieldOfIgnoredType;
@ -333,13 +338,14 @@ struct EmptyNamedNestedEnum
typedef unsigned long foo_t; typedef unsigned long foo_t;
typedef struct DLL_API SomeStruct typedef struct DLL_API SomeStruct
{ {
SomeStruct() : p(1) {} SomeStruct();
foo_t& operator[](int i) { return p; } foo_t& operator[](int i) { return p; }
// CSharp backend can't deal with a setter here // CSharp backend can't deal with a setter here
foo_t operator[](const char* name) { return p; } foo_t operator[](const char* name) { return p; }
foo_t p; foo_t p;
} } SomeStruct;
SomeStruct;
SomeStruct::SomeStruct() : p(1) {}
class DLL_API SomeClassExtendingTheStruct : public SomeStruct class DLL_API SomeClassExtendingTheStruct : public SomeStruct
{ {
@ -358,11 +364,15 @@ namespace SomeNamespace
class DLL_API ClassWithOverloadedOperators class DLL_API ClassWithOverloadedOperators
{ {
public: public:
ClassWithOverloadedOperators();
operator char() { return 1; } operator char() { return 1; }
operator int() { return 2; } operator int() { return 2; }
operator short() { return 3; } operator short() { return 3; }
}; };
ClassWithOverloadedOperators::ClassWithOverloadedOperators() {}
// Tests global static function generation // Tests global static function generation
DLL_API int Function() DLL_API int Function()
{ {
@ -372,13 +382,15 @@ DLL_API int Function()
// Tests properties // Tests properties
struct DLL_API TestProperties struct DLL_API TestProperties
{ {
TestProperties() : Field(0) {} TestProperties();
int Field; int Field;
int getFieldValue() { return Field; } int getFieldValue() { return Field; }
void setFieldValue(int Value) { Field = Value; } void setFieldValue(int Value) { Field = Value; }
}; };
TestProperties::TestProperties() : Field(0) {}
enum struct MyEnum { A, B, C }; enum struct MyEnum { A, B, C };
class DLL_API TestArraysPointers class DLL_API TestArraysPointers

Loading…
Cancel
Save