Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / IDL_Test / union_anonymous.idl
blob0800949f504db238896b2019f21ad3d735b0bb27
1 //=============================================================================
2 /**
3 * @file union_anonymous.idl
5 * This file contains examples of IDL code that has
6 * caused problems in the past for the TAO IDL
7 * compiler. This test is to make sure the problems
8 * stay fixed.
11 * @author Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
13 //=============================================================================
15 // Tricky case of lookup for a recursive union. When defined
16 // inside another datatype like this, the union is referenced
17 // inside itself before the closing brace is seen, but not
18 // declared yet.
19 struct Element
21 union ValueUnion switch (short)
23 case 0:
24 long lvalue;
25 case 1:
26 sequence<ValueUnion> VUValue;
27 } Value;
30 // Test for various kinds of declarations inside a union,
31 // similar to the example in enum_in_struct.idl.
32 typedef long NamedLongArray[10];
34 union decl_heavy_union switch (short)
36 case 1:
37 enum which
39 ZERO,
40 ONE,
41 TWO
42 } m_which;
43 case 2:
44 enum en
49 } m_en_arr[10];
50 case 3:
51 struct st
53 long a;
54 char b;
55 } m_st_arr[10];
56 case 4:
57 union un switch (long)
59 case 1: long a;
60 case 2: char b;
61 } m_un_arr[10];
62 // The following caused compile problems once
63 // when generating ostream ops
64 case 5:
65 NamedLongArray m_named_long_array;
66 case 6:
67 long m_anon_long_array[10];