re PR c++/23180 (Segfault on const initializer with bogus pointer arithmetics)
PR c++/23180 * g++.dg/init/pr23180-1.C: New test. * g++.dg/init/pr23180-2.C: New test. From-SVN: r104070
This commit is contained in:
parent
d047a20198
commit
84bb243df1
3 changed files with 34 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-09-08 Josh Conner <jconner@apple.com>
|
||||
|
||||
PR c++/23180
|
||||
* g++.dg/init/pr23180-1.C: New test.
|
||||
* g++.dg/init/pr23180-2.C: New test.
|
||||
|
||||
2005-09-09 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/18878
|
||||
|
|
17
gcc/testsuite/g++.dg/init/pr23180-1.C
Normal file
17
gcc/testsuite/g++.dg/init/pr23180-1.C
Normal file
|
@ -0,0 +1,17 @@
|
|||
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);
|
||||
}
|
11
gcc/testsuite/g++.dg/init/pr23180-2.C
Normal file
11
gcc/testsuite/g++.dg/init/pr23180-2.C
Normal file
|
@ -0,0 +1,11 @@
|
|||
struct Track {
|
||||
char soundName[15];
|
||||
};
|
||||
|
||||
struct SaveLoadEntry {
|
||||
int offs;
|
||||
int type;
|
||||
int size;
|
||||
};
|
||||
|
||||
int foobar = ((long) (& ((Track *) 42)->soundName[0])) - 42;
|
Loading…
Add table
Reference in a new issue