URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// Bug: g++ re-evaluates the initializer for r before calling f(); since i has
|
// Bug: g++ re-evaluates the initializer for r before calling f(); since i has
|
// changed to an invalid index, this breaks.
|
// changed to an invalid index, this breaks.
|
|
|
class C
|
class C
|
{
|
{
|
public:
|
public:
|
void f () { }
|
void f () { }
|
};
|
};
|
|
|
void foo (C * objs[])
|
void foo (C * objs[])
|
{
|
{
|
int i = 0;
|
int i = 0;
|
C & r = * objs[i]; /* make reference to element */
|
C & r = * objs[i]; /* make reference to element */
|
|
|
i = 666;
|
i = 666;
|
r.f (); /* core dumps here */
|
r.f (); /* core dumps here */
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
C * objs[1] = { new C };
|
C * objs[1] = { new C };
|
|
|
foo (objs);
|
foo (objs);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.