Ignore:
Timestamp:
Dec 13, 2016, 3:56:44 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
fc638d2
Parents:
0f35657
Message:

added tests for polymorphic tuples and cast on tuples, updated a couple of other tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/memberCtors.c

    r0f35657 rf7e749f  
    3232
    3333void ?{}(A * a, int x) {
     34  printf("begin construct A\n");
     35  printf("construct a->x\n");
    3436  (&a->x){ x+999 };
     37  printf("assign a->y\n");
    3538  a->y = 0; // not a constructor - default constructor will be inserted
     39  printf("end construct A\n");
    3640} // z never constructed - will be automatically default constructed
    3741
    3842void ?{}(A * this, A other) {
     43  printf("begin copy construct A\n");
     44  printf("copy construct this->x\n");
    3945  (&this->x){ other.x };
     46  printf("assign this->y\n");
    4047  this->y = other.y; // not a constructor - copy constructor will be inserted
     48  printf("end copy construct A\n");
    4149} // z never constructed - will be automatically copy constructed
    4250
     
    4654
    4755void ?{}(B * b) {
     56  printf("begin construct B\n");
     57  printf("assign b->a2\n");
    4858  b->a2 = (A) { 2 };
     59  printf("construct b->a1\n");
    4960  (&b->a1){ 1 };
    5061#ifdef ERR1
    5162  (&b->a2){ b->a3 }; // error, b->a2 was used previously but is explicitly constructed
    5263#endif
     64  printf("end construct B\n");
    5365} // a2, a3 never constructed - will be automatically default constructed
    5466
Note: See TracChangeset for help on using the changeset viewer.