Changeset 223a633 for tests/nested-types.cfa
- Timestamp:
- Oct 15, 2020, 3:41:38 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b9537e6
- Parents:
- 33c3ded (diff), 0b18db7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
tests/nested-types.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/nested-types.cfa
r33c3ded r223a633 10 10 // Created On : Mon Jul 9 10:20:03 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 12 18:21:15202013 // Update Count : 312 // Last Modified On : Sun Sep 27 08:48:59 2020 13 // Update Count : 6 14 14 // 15 15 16 16 typedef int N; 17 17 struct A { 18 forall(otype T)19 struct N {20 T x;21 };18 forall(otype T) 19 struct N { 20 T x; 21 }; 22 22 }; 23 23 24 24 struct S { 25 struct T {26 int i;27 typedef int Bar;28 };29 T x;25 struct T { 26 int i; 27 typedef int Bar; 28 }; 29 T x; 30 30 31 // struct U;32 typedef T Bar;33 typedef int Baz;31 // struct U; 32 typedef T Bar; 33 typedef int Baz; 34 34 }; 35 35 … … 65 65 66 66 int main() { 67 // access nested struct68 S.T x;67 // access nested struct 68 S.T x; 69 69 70 {71 struct S {72 int i;73 struct Z {74 double d;75 };76 };70 { 71 struct S { 72 int i; 73 struct Z { 74 double d; 75 }; 76 }; 77 77 78 S.Z z;// gets local S79 .S.T y;// lookup at global scope only78 S.Z z; // gets local S 79 .S.T y; // lookup at global scope only 80 80 81 const volatile .S.T q;81 const volatile .S.T q; 82 82 #if ERR1 83 T err1;// error: no T in scope83 T err1; // error: no T in scope 84 84 #endif 85 85 #if ERR2 86 .Z err2;// error: no Z in global scope87 .S.Baz.Bar err3;// error: .S.Baz => int, int is not aggregate and should not appear left of the dot88 .S.Z err4;// error: no Z in global S86 .Z err2; // error: no Z in global scope 87 .S.Baz.Bar err3; // error: .S.Baz => int, int is not aggregate and should not appear left of the dot 88 .S.Z err4; // error: no Z in global S 89 89 #endif 90 }90 } 91 91 92 // U.S un;92 // U.S un; 93 93 94 S.Bar y;95 S.Baz x;96 S.T.Bar z;94 S.Bar y; 95 S.Baz x; 96 S.T.Bar z; 97 97 98 // A.N(int) x; // xxx - should not be an error, but currently is. 98 // A.N(int) x; // xxx - should not be an error, but currently is. 99 100 #pragma message( "Compiled" ) // force non-empty .expect file 99 101 } 100 102
Note:
See TracChangeset
for help on using the changeset viewer.