Hi all!
There is the cpp-test “p755a.cpp”:
// It checks to see if you can define your own global delete operator.
extern “C” void _exit(int);
void operator delete(void p) throw() {
_exit(0);
}
int main () {
int i = new int;
delete i;
return 1;
}
clang-3.8 returns 0 with O0 and returns 1 with O1
gcc always returns 0
clang with O1 uses default “delete”:
clang-3.8 -c -S p755a.cpp -O1
…
main: # @main
.cfi_startproc
BB#0: # %entry
movl $1, %eax
retq
.Lfunc_end1:
.size main, .Lfunc_end1-main
.cfi_endproc
…
As far as I understand it is not right…
I will be grateful to get any explanations.
PS
I haven’t tested clang 4.0 yet…