Changeset b93a3de for src/tests/ctor-autogen.c
- Timestamp:
- Oct 19, 2017, 11:15:35 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 86f852b
- Parents:
- f232977
- git-author:
- Rob Schluntz <rschlunt@…> (10/13/17 16:07:34)
- git-committer:
- Rob Schluntz <rschlunt@…> (10/19/17 11:15:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/ctor-autogen.c
rf232977 rb93a3de 32 32 }; 33 33 34 // managed type - defines a constructor - can't use field constructors 35 struct Managed { 36 int x; 37 }; 38 39 void ?{}(Managed & m) { m.x = 0; } 40 41 // managed type since it contains a managed type - can't use field constructors 42 struct InheritManaged { 43 Managed m; 44 }; 45 34 46 forall(otype T) 35 47 T identity(T x) { return x; } … … 49 61 identity(s); // S should be an otype 50 62 63 SimpleStruct ss; 64 SimpleUnion su; 65 66 identity(ss); 67 identity(su); 68 51 69 PopulatedStruct ps; 52 70 PopulatedUnion pu; … … 54 72 identity(ps); // should recursively be an otype 55 73 identity(pu); // should recursively be an otype 74 75 #if ERR1 76 Managed x = { 123 }; // error 77 Managed y; // okay 78 79 InheritManaged z = { y }; // error? 80 #endif 81 56 82 }
Note: See TracChangeset
for help on using the changeset viewer.