Changes in tests/nested-types.cfa [6988dc6:66812dd]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/nested-types.cfa
r6988dc6 r66812dd 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 19 20 21 18 forall(otype T) 19 struct N { 20 T x; 21 }; 22 22 }; 23 23 24 24 struct S { 25 26 27 28 29 25 struct T { 26 int i; 27 typedef int Bar; 28 }; 29 T x; 30 30 31 32 33 31 // struct U; 32 typedef T Bar; 33 typedef int Baz; 34 34 }; 35 35 … … 65 65 66 66 int main() { 67 68 67 // access nested struct 68 S.T x; 69 69 70 71 72 73 74 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 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 92 // U.S un; 93 93 94 95 96 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.