Static Analysis Problem Type Reference
There is a declaration that hides the new or delete intrinsic function.
This is dangerous since it can cause code to behave unexpectedly. It can also cause confusing compilation errors.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Definition |
This shows where the redefinition was defined |
#include <stdio.h>
#include <new>
class A
{
public:
void speak() {
printf("hello");
}
};
void * operator new(size_t size) throw (std::bad_alloc) {
return NULL;
};
int main()
{
A *a = new A;
a->speak();
delete a;
return 0;
}