ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumwith_gc
Last change
on this file since 2b22e050 was
80e8582,
checked in by Rob Schluntz <rschlunt@…>, 7 years ago
|
Move constructor/destructor tests to raii subdirectory
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | #include <fstream> |
---|
2 | |
---|
3 | struct value_t { |
---|
4 | int value; |
---|
5 | }; |
---|
6 | |
---|
7 | void ?{}( value_t & this ) { this.value = 22; } |
---|
8 | |
---|
9 | //Standard case |
---|
10 | struct g_t { |
---|
11 | value_t val; |
---|
12 | }; |
---|
13 | |
---|
14 | void ?{}( g_t & this ) { (this.val){}; } |
---|
15 | |
---|
16 | g_t g; |
---|
17 | |
---|
18 | //Autogen case |
---|
19 | struct ga_t { |
---|
20 | value_t val; |
---|
21 | }; |
---|
22 | |
---|
23 | ga_t ga; |
---|
24 | |
---|
25 | //Inline case |
---|
26 | struct gi_t; |
---|
27 | void ?{}( gi_t & this ); |
---|
28 | |
---|
29 | struct gi_t { |
---|
30 | value_t val; |
---|
31 | } gi; |
---|
32 | |
---|
33 | void ?{}( gi_t & this ) { (this.val){}; } |
---|
34 | |
---|
35 | //Inline autogen case |
---|
36 | struct gia_t { |
---|
37 | value_t val; |
---|
38 | } gia; |
---|
39 | |
---|
40 | //Static case |
---|
41 | struct gs_t { |
---|
42 | value_t val; |
---|
43 | }; |
---|
44 | |
---|
45 | void ?{}( gs_t & this ) { (this.val){}; } |
---|
46 | |
---|
47 | static gs_t gs; |
---|
48 | |
---|
49 | //Static autogen case |
---|
50 | struct gsa_t { |
---|
51 | value_t val; |
---|
52 | }; |
---|
53 | |
---|
54 | static gsa_t gsa; |
---|
55 | |
---|
56 | //Static inline case |
---|
57 | struct gsi_t; |
---|
58 | void ?{}( gsi_t & this ); |
---|
59 | |
---|
60 | static struct gsi_t { |
---|
61 | value_t val; |
---|
62 | } gsi; |
---|
63 | |
---|
64 | void ?{}( gsi_t & this ) { (this.val){}; } |
---|
65 | |
---|
66 | //Static inline autogen case |
---|
67 | static struct gsia_t { |
---|
68 | value_t val; |
---|
69 | } gsia; |
---|
70 | |
---|
71 | int main() { |
---|
72 | sout | "static\t\tinline\t\tautogen\t\tvalue" | endl; |
---|
73 | |
---|
74 | sout | "no \t\tno \t\tno \t\t" | g.val.value | endl; |
---|
75 | sout | "no \t\tno \t\tyes\t\t" | ga.val.value | endl; |
---|
76 | sout | "no \t\tyes\t\tno \t\t" | gi.val.value | endl; |
---|
77 | sout | "no \t\tyes\t\tyes\t\t" | gia.val.value | endl; |
---|
78 | sout | "yes\t\tno \t\tno \t\t" | gs.val.value | endl; |
---|
79 | sout | "yes\t\tno \t\tyes\t\t" | gsa.val.value | endl; |
---|
80 | sout | "yes\t\tyes\t\tno \t\t" | gsi.val.value | endl; |
---|
81 | sout | "yes\t\tyes\t\tyes\t\t" | gsia.val.value | endl; |
---|
82 | |
---|
83 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.