Merge from mainline, version 106440, to sh-elf-4_1-branch .
[official-gcc.git] / gcc / testsuite / g++.dg / init / struct3.C
blob6b1805c66ba972312201e5106b7dc29169cc883d
1 /* PR c++/23180.  */
2 /* Initialize a global variable with an expression that attempts to use
3    pointer arithmetic to calculate a structure field offset.  */
5 struct Track {
6   char soundName[15];
7 };
9 struct SaveLoadEntry {
10   int offs;
11   int type;
12   int size;
13 };    
15 int foobar = ((long) (& ((Track *) 42)->soundName[0])) - 42;