mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 01:51:29 +00:00
Clang uses CMOV for ternary operators which does not immediately trigger an error. Using double free and new/free mismatch still poses no problem with clang but still uses the demangling. Also update .gitignore
32 lines
459 B
C++
32 lines
459 B
C++
// Simple smoke test to see that the demangler is actually working
|
|
#include <cstdlib>
|
|
|
|
namespace abc {
|
|
template <typename T1, typename T2>
|
|
class def {
|
|
public:
|
|
T1 xyzzy(T1 *p, T2 *)
|
|
{
|
|
free(p);
|
|
return 10;
|
|
}
|
|
};
|
|
};
|
|
|
|
template <typename T>
|
|
class magic {
|
|
public:
|
|
T xyzzy(T *p)
|
|
{
|
|
return (new abc::def<int,typeof(*this)>)->xyzzy(p, 0);
|
|
}
|
|
};
|
|
|
|
int main()
|
|
{
|
|
magic<int> *c = new magic<int>;
|
|
|
|
c->xyzzy(new int);
|
|
return 0;
|
|
}
|