This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Tests for PR c++/23180


OK for mainline?

- Josh

2005-09-09 Josh Conner <jconner@apple.com>

        PR c++/23180
        * g++.dg/init/struct2.C: New test.
        * g++.dg/init/struct3.C: New test.

struct Track {
  char soundName[15];
};

struct SaveLoadEntry {
  int offs;
  int type;
  int size;
};    

int foobar = ((long) (& ((Track *) 42)->soundName[0])) - 42;
void saveLoadEntries(const void *);
void saveOrLoad() {
    struct Track {
        char soundName[15];
    };
    struct SaveLoadEntry {
        int offs;
        int type;
        int size;
    };    

    SaveLoadEntry trackEntries = {
	((long) (&((Track *) 42)->soundName[0])) - 42,
        0, 1
    };
    saveLoadEntries(&trackEntries);
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]