1 // Build with "cl.exe /Zi /GR- /GX- every-type.cpp /link /debug /nodefaultlib /entry:main"
2
3 // clang-format off
4 void *__purecall = 0;
5
operator delete(void *,unsigned int)6 void __cdecl operator delete(void *,unsigned int) {}
7
8 struct FooStruct { }; // LF_STRUCTURE
9
10 class FooClass { // LF_CLASS
11 // LF_FIELDLIST
12 enum NestedEnum { // LF_ENUM
13 // LF_NESTTYPE
14 A, B, C // LF_ENUMERATE
15 };
16
RegularMethod()17 void RegularMethod() {} // LF_ARGLIST
18 // LF_ONEMETHOD
19 // LF_MFUNCTION
20
OverloadedMethod(int)21 void OverloadedMethod(int) {} // LF_METHODLIST
22 // LF_METHOD
OverloadedMethod(int,int)23 void OverloadedMethod(int, int) {}
24
25 int HiNibble : 4; // LF_BITFIELD
26 int LoNibble : 4;
27 NestedEnum EnumVariable; // LF_MEMBER
28 static void *StaticMember; // LF_POINTER
29 // LF_STMEMBER
30 };
31
32 void *FooClass::StaticMember = nullptr;
33
34 class Inherit : public FooClass { // LF_BCLASS
35 public:
~Inherit()36 virtual ~Inherit() {} // LF_VTSHAPE
37 // LF_VFUNCTAB
38 };
39
40 class VInherit : public virtual FooClass { // LF_VBCLASS
41
42 };
43
44 class IVInherit : public VInherit { // LF_IVBCLASS
45 };
46
47 union TheUnion {
48 int X; // LF_UNION
49 };
50
51 int SomeArray[7] = {1, 2, 3, 4, 5, 6, 7}; // LF_ARRAY
52
main(int argc,char ** argv)53 int main(int argc, char **argv) { // LF_PROCEDURE
54 const int X = 7; // LF_MODIFIER
55
56 FooStruct FooStructInstance;
57 FooClass FooClassInstance;
58 Inherit InheritInstance;
59 VInherit VInheritInstance;
60 IVInherit IVInheritInstance;
61 TheUnion UnionInstance;
62 return SomeArray[argc];
63 }
64