Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.dg / init / struct2.C
blobd7d07b5c1e3101dc0e52ddb514de20d6ffee4de3
1 /* PR c++/23180.  */
2 /* Initialize a local structure with an expression that attempts to use
3    pointer arithmetic to calculate another structure field offset.  */
5 void saveLoadEntries(const void *);
7 void saveOrLoad() {
8     struct Track {
9         char soundName[15];
10     };
11     struct SaveLoadEntry {
12         int offs;
13         int type;
14         int size;
15     };    
17     SaveLoadEntry trackEntries = {
18         ((long) (&((Track *) 42)->soundName[0])) - 42,
19         0, 1
20     };
21     saveLoadEntries(&trackEntries);