Changeset 72f85de
- Timestamp:
- Oct 20, 2017, 11:58:18 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 88e79ad
- Parents:
- 837ce06
- Location:
- src/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/memberCtors-ERR1.txt
r837ce06 r72f85de 1 memberCtors.c:7 1:1 error: in void ?{}(B &b), field a2 used before being constructed1 memberCtors.c:78:1 error: in void ?{}(B &b), field a2 used before being constructed -
src/tests/.expect/memberCtors.txt
r837ce06 r72f85de 98 98 end copy construct A 99 99 End of main 100 begin destruct B 100 101 constructing int 101 102 constructing int … … 146 147 destructing int: 0 147 148 destructing int: 1000 148 destructing int: 0 149 destructing int: 0 150 destructing int: 999 151 destructing int: 0 152 destructing int: 0 153 destructing int: 0 154 destructing int: 0 155 destructing int: 0 156 destructing int: 999 149 end destruct B 150 destructing int: 0 151 destructing int: 0 152 destructing int: 999 153 destructing int: 0 154 destructing int: 0 155 destructing int: 0 156 destructing int: 0 157 destructing int: 0 158 destructing int: 999 159 begin destruct B 157 160 constructing int 158 161 constructing int … … 203 206 destructing int: 0 204 207 destructing int: 1000 205 destructing int: 0 206 destructing int: 0 207 destructing int: 999 208 destructing int: 0 209 destructing int: 0 210 destructing int: 0 211 destructing int: 0 212 destructing int: 0 213 destructing int: 999 208 end destruct B 209 destructing int: 0 210 destructing int: 0 211 destructing int: 999 212 destructing int: 0 213 destructing int: 0 214 destructing int: 0 215 destructing int: 0 216 destructing int: 0 217 destructing int: 999 -
src/tests/memberCtors.c
r837ce06 r72f85de 22 22 } 23 23 24 void ?=?(WrappedInt & this, int x) {24 /* WrappedInt */ void ?=?(WrappedInt & this, int x) { 25 25 printf("assigning int: %d %d\n", this.x, x); 26 26 this.x = x; 27 // return this; 27 28 } 29 30 // WrappedInt ?=?(WrappedInt & this, WrappedInt other) { 31 // printf("assigning int: %d %d\n", this.x, other.x); 32 // this.x = other.x; 33 // return this; 34 // } 28 35 29 36 struct A { … … 79 86 80 87 void ^?{}(B & b) { 88 printf("begin destruct B\n"); 81 89 b.a2 = (A) { 0 }; 82 90 ^(b.a1){}; 91 printf("end destruct B\n"); 83 92 } // a2, a3 never destructed - will be automatically destructed 84 93 85 94 int main() { 86 95 printf("Before declaration of b1\n"); 87 B b1; 96 B b1; // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } } 88 97 printf("Before declaration of b2\n"); 89 98 B b2 = b1;
Note: See TracChangeset
for help on using the changeset viewer.