-
Notifications
You must be signed in to change notification settings - Fork 524
/
Copy pathCommon.h
1599 lines (1313 loc) · 32.3 KB
/
Common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "../Tests.h"
#include "AnotherUnit.h"
#ifdef _WIN32
#include <vadefs.h>
#endif
#include <string>
#include <vector>
#include <memory>
class DLL_API TestPacking
{
public:
int i1;
int i2;
bool b;
TestPacking();
};
#pragma pack(1)
class DLL_API TestPacking1: public TestPacking
{
public:
TestPacking1();
~TestPacking1();
};
#pragma pack(2)
class DLL_API TestPacking2: public TestPacking
{
public:
TestPacking2();
~TestPacking2();
};
#pragma pack(4)
class DLL_API TestPacking4: public TestPacking
{
public:
TestPacking4();
~TestPacking4();
};
#pragma pack(8)
class DLL_API TestPacking8: public TestPacking
{
public:
TestPacking8();
~TestPacking8();
};
#pragma pack()
class DLL_API IgnoredType
{
class IgnoredNested
{
private:
int i;
};
private:
int i;
};
class DLL_API Foo
{
private:
enum Private
{
Value1,
Value2
};
public:
enum
{
EmptyEnum1,
EmptyEnum2
};
class NestedAbstract
{
public:
virtual ~NestedAbstract();
virtual int* abstractFunctionInNestedClass() = 0;
};
Foo();
Foo(const Foo& other);
Foo(Private p);
Foo(const float& f);
int A;
float B;
int Init = 20;
IgnoredType ignoredType;
int fixedArray[3];
char fixedCharArray[3];
void* ptr;
static const int unsafe;
static const char charArray[];
static int readWrite;
const char* GetANSI();
// Not properly handled yet - ignore
float nested_array[2][2];
// Primitive pointer types
const int* SomePointer;
const int** SomePointerPointer;
typedef Foo* FooPtr;
typedef uint8_t* typedefPrimitivePointer;
typedefPrimitivePointer fieldOfTypedefPrimitivePointer;
void TakesTypedefedPtr(FooPtr date);
int TakesRef(const Foo& other);
bool operator ==(const Foo& other) const;
int fooPtr();
char16_t returnChar16();
};
struct DLL_API Bar
{
enum Item
{
Item1,
Item2
};
Bar();
explicit Bar(const Foo* foo);
Bar(Foo foo);
Item RetItem1() const;
int A;
float B;
Item fixedEnumArray[3];
Bar* returnPointerToValueType();
bool operator ==(const Bar& arg1) const;
};
DLL_API bool operator ==(Bar::Item item, const Bar& bar);
class DLL_API Foo2 : public Foo
{
struct Copy {
Foo A;
}* copy;
public:
Foo2();
Foo2(const Foo2& other);
int C;
Foo2 operator<<(signed int i);
Foo2 operator<<(signed long l);
Bar valueTypeField;
char testCharMarshalling(char c);
void testKeywordParam(void* where, Bar::Item event, int ref);
};
DLL_API Bar::Item operator |(Bar::Item left, Bar::Item right);
struct DLL_API Bar2 : public Bar
{
// Conversion operators
struct DLL_API Nested
{
Nested();
operator int() const;
};
operator int() const;
operator Foo2();
Foo2 needFixedInstance() const;
typedef void *Bar2::*FunctionPointerResolvedAsVoidStar;
operator FunctionPointerResolvedAsVoidStar() const { return 0; }
int C;
Bar* pointerToStruct;
int* pointerToPrimitive;
Foo2* pointerToClass;
Bar valueStruct;
};
enum Enum
{
A = 0, B = 2, C = 5,
//D = 0x80000000,
E = 0x1,
F = -9,
NAME_A = 10,
NAME__A = 20
};
typedef char TypedefChar;
class DLL_API Hello
{
union NestedPrivate {
int i;
float f;
};
public:
union NestedPublic {
int j;
float g;
long l;
};
Hello ();
Hello(const Hello& hello);
void PrintHello(const char* s);
bool test1(int i, float f);
int add(int a, int b);
int AddFoo(Foo);
int AddFooRef(Foo&);
int AddFooPtr(Foo*);
int AddFooPtrRef(Foo*&);
Foo RetFoo(int a, float b);
int AddFoo2(Foo2);
int AddBar(Bar);
int AddBar2(Bar2);
int RetEnum(Enum);
Hello* RetNull();
bool TestPrimitiveOut(CS_OUT float* f);
bool TestPrimitiveOutRef(CS_OUT float& f);
bool TestPrimitiveInOut(int* i);
bool TestPrimitiveInOutRef(int& i);
void EnumOut(int value, CS_OUT Enum* e);
void EnumOutRef(int value, CS_OUT Enum& e);
void EnumInOut(Enum* e);
void EnumInOutRef(Enum& e);
void StringOut(CS_OUT const char** str);
void StringOutRef(CS_OUT const char*& str);
void StringInOut(CS_IN_OUT const char** str);
void StringInOutRef(CS_IN_OUT const char*& str);
void StringTypedef(const TypedefChar* str);
};
class DLL_API AbstractFoo
{
public:
virtual ~AbstractFoo();
virtual int pureFunction(int i = 0) = 0;
virtual int pureFunction1() = 0;
virtual int pureFunction2(bool* ok = 0) = 0;
};
class DLL_API ImplementsAbstractFoo : public AbstractFoo
{
public:
typedef int typedefInOverride;
virtual int pureFunction(typedefInOverride i = 0);
virtual int pureFunction1();
private:
virtual int pureFunction2(bool* ok = 0);
};
class DLL_API ReturnsAbstractFoo
{
public:
ReturnsAbstractFoo();
~ReturnsAbstractFoo();
const AbstractFoo& getFoo();
private:
ImplementsAbstractFoo i;
};
int DLL_API unsafeFunction(const Bar& ret, char* testForString, void (*foo)(int));
DLL_API Bar indirectReturn();
// Tests CheckVirtualOverrideReturnCovariance
struct Exception;
typedef Exception Ex1;
struct DerivedException;
typedef DerivedException Ex2;
struct DLL_API Exception : public Foo
{
virtual ~Exception();
virtual Ex1* clone() = 0;
};
struct DLL_API DerivedException : public Exception
{
virtual Ex2* clone() override;
};
// Tests for ambiguous call to native functions with default parameters
struct DLL_API DefaultParameters
{
DefaultParameters();
void Foo(int a, int b = 0);
void Foo(int a);
void Bar() const;
void Bar();
};
// The Curiously Recurring Template Pattern (CRTP)
template<class Derived>
class Base
{
// methods within Base can use template to access members of Derived
Derived* create() { return new Derived(); }
};
class Derived : public Base<Derived>
{
};
// Tests the MoveFunctionToClassPass
class DLL_API common
{
public:
common();
};
DLL_API int test(common& s);
// Tests the MoveOperatorToClassPass
struct DLL_API TestMoveOperatorToClass
{
TestMoveOperatorToClass();
int A;
int B;
};
DLL_API int operator *(TestMoveOperatorToClass klass, int b);
DLL_API TestMoveOperatorToClass operator-(const TestMoveOperatorToClass& b);
DLL_API TestMoveOperatorToClass operator+(const TestMoveOperatorToClass& b1,
const TestMoveOperatorToClass& b2);
// Not a valid operator overload for Foo2 in managed code - comparison operators need to return bool.
DLL_API int operator==(const Foo2& a, const Foo2& b);
// Tests delegates
typedef int (*DelegateInGlobalNamespace)(int);
typedef int (STDCALL *DelegateStdCall)(int);
typedef int (CDECL *DelegateCDecl)(int n);
typedef void(*DelegateNullCheck)(void);
struct DLL_API TestDelegates
{
typedef int (*DelegateInClass)(int);
typedef int(TestDelegates::*MemberDelegate)(int);
TestDelegates();
static int Double(int N);
int Triple(int N);
int StdCall(DelegateStdCall del);
int CDecl(DelegateCDecl del);
void MarshalUnattributedDelegate(DelegateInGlobalNamespace del);
int MarshalAnonymousDelegate(int (*del)(int n));
void MarshalAnonymousDelegate2(int (*del)(int n));
void MarshalAnonymousDelegate3(float (*del)(float n));
int (*MarshalAnonymousDelegate4())(int n);
int MarshalAnonymousDelegate5(int (STDCALL *del)(int n));
int MarshalAnonymousDelegate6(int (STDCALL *del)(int n));
void MarshalDelegateInAnotherUnit(DelegateInAnotherUnit del);
DelegateNullCheck MarshalNullDelegate();
DelegateInClass A;
DelegateInGlobalNamespace B;
// As long as we can't marshal them make sure they're ignored
MemberDelegate C;
};
namespace DelegateNamespace
{
namespace Nested
{
void DLL_API f1(void (*)());
}
void DLL_API f2(void (*)());
}
// Tests memory leaks in constructors
// C#: Marshal.FreeHGlobal(arg0);
struct DLL_API TestMemoryLeaks
{
TestMemoryLeaks(const char* name) {}
};
// Tests that finalizers are generated
/* CLI: ~TestFinalizers() */
struct DLL_API TestFinalizers
{
};
// Tests static classes
struct DLL_API TestStaticClass
{
static int Add(int a, int b);
static int GetOneTwoThree();
TestStaticClass& operator=(const TestStaticClass& oth);
private:
static int _Mult(int a, int b);
static int GetFourFiveSix();
TestStaticClass();
};
struct DLL_API TestStaticClassDerived : TestStaticClass
{
static int Foo();
private:
TestStaticClassDerived();
};
class DLL_API TestNotStaticClass
{
public:
static TestNotStaticClass StaticFunction();
private:
TestNotStaticClass();
};
class HasIgnoredField
{
Base<Derived> fieldOfIgnoredType;
};
template <typename T>
class DependentTypeWithNestedIndependent
{
T array[1];
union
{
int i;
long l;
};
};
class DLL_API TestCopyConstructorRef
{
public:
TestCopyConstructorRef();
TestCopyConstructorRef(const TestCopyConstructorRef& other);
int A;
float B;
};
template <class T>
struct EmptyNamedNestedEnum
{
enum { Value = 10 };
};
typedef unsigned long foo_t;
typedef struct DLL_API SomeStruct
{
SomeStruct();
foo_t p;
} SomeStruct;
class DLL_API SomeClassExtendingTheStruct : public SomeStruct
{
};
namespace SomeNamespace
{
class DLL_API AbstractClass
{
public:
~AbstractClass();
virtual void AbstractMethod() = 0;
};
}
// Test operator overloads
class DLL_API ClassWithOverloadedOperators
{
public:
ClassWithOverloadedOperators();
operator char();
operator int();
operator short();
virtual bool operator<(const ClassWithOverloadedOperators &other) const;
};
// Tests global static function generation
DLL_API int Function();
// Tests properties
struct DLL_API TestProperties
{
public:
enum class NestedEnum
{
Value1,
Value2
};
enum class Conflict
{
Value1,
Value2
};
TestProperties();
TestProperties(const TestProperties& other);
TestProperties& operator=(const TestProperties& other);
int Field;
const int& ConstRefField;
int getFieldValue();
void setFieldValue(int Value);
bool isVirtual();
virtual void setVirtual(bool value);
double refToPrimitiveInSetter() const;
void setRefToPrimitiveInSetter(const double& value);
int getterAndSetterWithTheSameName();
void getterAndSetterWithTheSameName(int value);
int Get() const;
void Set(int value);
int get() const;
void set(int value);
int setterReturnsBoolean();
bool setSetterReturnsBoolean(int newValue);
virtual int virtualSetterReturnsBoolean();
virtual bool setVirtualSetterReturnsBoolean(int newValue);
int nestedEnum();
int nestedEnum(int i);
int get32Bit();
bool isEmpty();
bool empty();
virtual int virtualGetter();
int startWithVerb();
void setStartWithVerb(int value);
void setSetterBeforeGetter(bool value);
bool isSetterBeforeGetter();
bool contains(char c);
bool contains(const char* str);
Conflict GetConflict();
void SetConflict(Conflict _conflict);
virtual int(*getCallback())(int);
virtual void setCallback(int(*value)(int));
int GetArchiveName() const;
protected:
const int ArchiveName;
private:
int FieldValue;
double _refToPrimitiveInSetter;
int _getterAndSetterWithTheSameName;
int _setterReturnsBoolean;
int _virtualSetterReturnsBoolean;
Conflict _conflict;
int(*_callback)(int);
};
class DLL_API HasOverridenSetter : public TestProperties
{
public:
HasOverridenSetter();
void setVirtual(bool value) override;
int virtualSetterReturnsBoolean() override;
bool setVirtualSetterReturnsBoolean(int value) override;
int virtualGetter() override;
void setVirtualGetter(int value);
};
class DLL_API TypeMappedIndex
{
public:
TypeMappedIndex();
};
class DLL_API TestIndexedProperties
{
public:
TestIndexedProperties();
// Should lead to a read/write indexer with return type uint
foo_t& operator[](int i);
// Should lead to a read/write indexer with return type uint
foo_t* operator[](float f);
// Should lead to a read-only indexer with return type uint
foo_t operator[](const char* name);
// Should lead to a read-only indexer with return type uint*
const foo_t& operator[](double d);
// Should lead to a read/write indexer with return type TestProperties
TestProperties* operator[](unsigned char b);
// Should lead to a read-only indexer with return type TestProperties
const TestProperties& operator[](short b);
// Should lead to a read-only indexer with argument type TestProperties
foo_t operator[](TestProperties b);
Bar& operator[](unsigned long i);
Bar& operator[](const TypeMappedIndex& key);
Bar& operator[](const Foo& key);
// Test that we do not generate 'ref int' parameters as C# does not allow it
int operator[](CS_OUT char key);
private:
foo_t p;
TestProperties f;
Bar bar;
};
struct DLL_API TestIndexedPropertiesInValueType
{
public:
int operator[](int i);
};
// Tests variables
struct DLL_API TestVariables
{
TestVariables();
static int VALUE;
void SetValue(int value = VALUE);
};
typedef const wchar_t * LPCWSTR;
struct DLL_API TestWideStrings
{
TestWideStrings();
LPCWSTR GetWidePointer();
LPCWSTR GetWideNullPointer();
};
enum struct MyEnum { A, B, C };
typedef void (*VoidPtrRetFunctionTypedef) ();
class DLL_API TestFixedArrays
{
public:
TestFixedArrays();
VoidPtrRetFunctionTypedef Array[10];
#ifndef _MSC_VER
TestWideStrings ZeroSizedClassArray[0];
MyEnum ZeroSizedEnumArray[0];
#endif
int ZeroSizedArray[0];
};
class DLL_API TestArraysPointers
{
public:
TestArraysPointers(MyEnum *values, int count);
MyEnum Value;
};
class DLL_API NonPrimitiveType
{
public:
NonPrimitiveType();
int GetFoo();
int foo;
};
class DLL_API TestFixedNonPrimitiveArrays
{
public:
TestFixedNonPrimitiveArrays();
NonPrimitiveType NonPrimitiveTypeArray[3];
};
struct DLL_API TestGetterSetterToProperties
{
TestGetterSetterToProperties();
int getWidth();
int getHeight();
};
// Tests conversion operators of classes
class DLL_API ClassA
{
public:
ClassA(int value);
int Value;
};
class DLL_API ClassB
{
public:
// conversion from ClassA (constructor):
ClassB(const ClassA& x);
int Value;
// conversion from ClassA (assignment):
//ClassB& operator= (const ClassA& x) { return *this; }
// conversion to ClassA (type-cast operator)
//operator ClassA() { return ClassA(); }
};
class DLL_API ClassC
{
public:
// This should NOT lead to a conversion
ClassC(const ClassA* x);
// This should lead to an explicit conversion
explicit ClassC(const ClassB& x);
int Value;
};
class DLL_API ClassD
{
public:
ClassD(int value);
// Accessing this field should return reference, not a copy.
ClassA Field;
};
// Test decltype
int Expr = 0;
DLL_API decltype(Expr) TestDecltype();
DLL_API void TestNullPtrType(decltype(nullptr));
DLL_API decltype(nullptr) TestNullPtrTypeRet();
// Tests dependent name types
template<typename T> struct DependentType
{
DependentType(typename T::Dependent* t) { }
private:
struct Bitset { int length : sizeof(T); };
};
class PureDtor
{
public:
virtual ~PureDtor() = 0;
};
DLL_API void va_listFunction(va_list v);
struct DLL_API TestNestedTypes
{
public:
TestNestedTypes();
~TestNestedTypes();
union as_types
{
int as_int;
struct uchars
{
unsigned char blue, green, red, alpha;
} as_uchar;
};
int toVerifyCorrectLayoutBefore;
union
{
int i;
char c;
};
int toVerifyCorrectLayoutAfter;
};
class DLL_API HasStdString
{
public:
HasStdString();
~HasStdString();
std::string testStdString(const std::string& s);
std::string testStdStringPassedByValue(std::string s);
std::string s;
std::string& getStdString();
};
class DLL_API HasStdWString
{
public:
HasStdWString();
~HasStdWString();
std::wstring testStdWString(const std::wstring& s);
std::wstring testStdWStringPassedByValue(std::wstring s);
std::wstring s;
std::wstring& getStdWString();
};
class DLL_API InternalCtorAmbiguity
{
public:
InternalCtorAmbiguity(void* param);
};
class DLL_API InvokesInternalCtorAmbiguity
{
public:
InvokesInternalCtorAmbiguity();
InternalCtorAmbiguity* InvokeInternalCtor();
private:
InternalCtorAmbiguity* ptr;
};
class DLL_API HasFriend
{
public:
HasFriend(int m);
DLL_API friend const HasFriend operator+(const HasFriend& f1, const HasFriend& f2);
DLL_API friend const HasFriend operator-(const HasFriend& f1, const HasFriend& f2);
int getM();
private:
int m;
};
template<typename T> class FriendTemplate
{
template<typename TT>
friend FriendTemplate<TT> func(const FriendTemplate<TT>&);
template<typename TT>
friend class FriendTemplate;
};
class DLL_API DifferentConstOverloads
{
public:
DifferentConstOverloads();
int getI() const;
bool operator ==(const DifferentConstOverloads& other);
bool operator !=(const DifferentConstOverloads& other);
bool operator ==(int number) const;
bool operator ==(std::string s) const;
private:
int i;
};
DLL_API bool operator ==(const DifferentConstOverloads& d, const char* s);
class TestNamingAnonymousTypesInUnion
{
public:
union {
struct {
} argb;
struct {
} ahsv;
struct {
} acmyk;
} ct;
};
class DLL_API RefTypeClassPassTry
{
public:
RefTypeClassPassTry();
};
void DLL_API funcTryRefTypePtrOut(CS_OUT RefTypeClassPassTry* classTry);
void DLL_API funcTryRefTypeOut(CS_OUT RefTypeClassPassTry classTry);
#define ARRAY_LENGTH 5
#define CS_VALUE_TYPE
struct CS_VALUE_TYPE ValueTypeArrays
{
float firstValueTypeArrray[ARRAY_LENGTH];
int secondValueTypeArray[ARRAY_LENGTH];
char thirdValueTypeArray[ARRAY_LENGTH];
size_t size;
};
class DLL_API HasVirtualProperty
{
public:
virtual int getProperty();
virtual void setProperty(int target);
protected:
virtual int getProtectedProperty();
virtual void setProtectedProperty(int value);
};
class DLL_API ChangedAccessOfInheritedProperty : public HasVirtualProperty
{
public:
ChangedAccessOfInheritedProperty();
int getProtectedProperty();
void setProtectedProperty(int value);
protected:
int getProperty();
void setProperty(int value);
};
class DLL_API Empty
{
};
class DLL_API ReturnsEmpty
{
public:
ReturnsEmpty();
Empty getEmpty();
};
class DLL_API CS_VALUE_TYPE ValueTypeClassPassTry { };
void DLL_API funcTryValTypePtrOut(CS_OUT ValueTypeClassPassTry* classTry);
void DLL_API funcTryValTypeOut(CS_OUT ValueTypeClassPassTry classTry);
class DLL_API HasProblematicFields
{
public:
HasProblematicFields();
bool b;
char c;
};
class DLL_API HasVirtualReturningHasProblematicFields
{
public:
HasVirtualReturningHasProblematicFields();
virtual HasProblematicFields returnsProblematicFields();
};
class DLL_API BaseClassVirtual
{
public:
typedef Foo Foo1;
virtual int retInt(const Foo1& foo);
static BaseClassVirtual getBase();
};
class DLL_API DerivedClassVirtual : public BaseClassVirtual
{
public:
typedef Foo Foo2;
virtual int retInt(const Foo2& foo);
};
class DLL_API DerivedClassAbstractVirtual : public DerivedClassVirtual
{
public:
~DerivedClassAbstractVirtual();
virtual int retInt(const Foo& foo) = 0;
};
class DLL_API DerivedClassOverrideAbstractVirtual : public DerivedClassAbstractVirtual
{
public:
DerivedClassOverrideAbstractVirtual();
virtual int retInt(const Foo& foo);
};
class DLL_API BufferForVirtualFunction : public BaseClassVirtual
{
public:
BufferForVirtualFunction();
};
class DLL_API OverridesNonDirectVirtual : public BufferForVirtualFunction