OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [struct2.C] - Blame information for rev 704

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* PR c++/23180.  */
2
/* Initialize a local structure with an expression that attempts to use
3
   pointer arithmetic to calculate another structure field offset.  */
4
 
5
void saveLoadEntries(const void *);
6
 
7
void saveOrLoad() {
8
    struct Track {
9
        char soundName[15];
10
    };
11
    struct SaveLoadEntry {
12
        int offs;
13
        int type;
14
        int size;
15
    };
16
 
17
    SaveLoadEntry trackEntries = {
18
        ((long) (__SIZE_TYPE__) (&((Track *) 42)->soundName[0])) - 42,
19
        0, 1
20
    };
21
    saveLoadEntries(&trackEntries);
22
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.