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 384 |
// { dg-do assemble }
|
// { dg-do assemble }
|
// GROUPS passed delete
|
// GROUPS passed delete
|
/*
|
/*
|
Bug Id:
|
Bug Id:
|
PRMS Id: p0000710
|
PRMS Id: p0000710
|
Bug is : overloading operator delete in class def not allowed
|
Bug is : overloading operator delete in class def not allowed
|
*/
|
*/
|
|
|
/*
|
/*
|
In addition to this bug, the compiler permits overloading operator
|
In addition to this bug, the compiler permits overloading operator
|
delete in the class definition. This is verboten, and should be
|
delete in the class definition. This is verboten, and should be
|
caught by a regression suite. In other words, the following is also a
|
caught by a regression suite. In other words, the following is also a
|
bug that's not caught:
|
bug that's not caught:
|
*/
|
*/
|
|
|
|
|
#include
|
#include
|
|
|
extern "C"
|
extern "C"
|
{
|
{
|
int printf(const char*, ...);
|
int printf(const char*, ...);
|
}
|
}
|
|
|
|
|
|
|
class B
|
class B
|
{
|
{
|
public:
|
public:
|
int x;
|
int x;
|
virtual ~B() {}
|
virtual ~B() {}
|
void operator delete(void*,size_t s)
|
void operator delete(void*,size_t s)
|
{
|
{
|
printf("B::delete() %d\n",s);
|
printf("B::delete() %d\n",s);
|
}
|
}
|
void operator delete(void*){}
|
void operator delete(void*){}
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
B* p = new B;
|
B* p = new B;
|
delete p;
|
delete p;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.