Changeset 72f85de for src/tests/memberCtors.c
- Timestamp:
- Oct 20, 2017, 11:58:18 AM (7 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.