URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [dtor5.C] - Rev 305
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// PRMS Id: 5286
// Bug: g++ forgets side-effects of object in call to nonexistent destructor.
#include <new>
int r;
template <class T> struct A {
T *p;
int i;
A() { i = 0; p = (T*) new char[sizeof (T)]; new (p + i++) T; }
~A() { p[--i].~T(); r = i; }
};
int main()
{
{ A<int> a; }
int* p = (int*) new char[sizeof (int)];
new (p + r++) int;
typedef int I;
p[--r].~I();
return r;
}
Go to most recent revision | Compare with Previous | Blame | View Log