title: In C++ is it possible to specify which delete operator is used?
body: <p>I am instrumenting some code and noticed that with the C++14 features there are two new <code>delete</code> operators (From <a href="http://en.cppreference.com/w/cpp/memory/new/operator_delete" rel="noreferrer">http://en.cppreference.com/w/cpp/memory/new/operator_delete</a>):</p>
  
  <blockquote>
    <p>These are  5-6) Called instead of (1-2) if a user-defined replacement
    is provided except that it's implementation-defined whether (1-2) or
    (5-6) is called when deleting objects of incomplete type and arrays of
    non-class and trivially-destructible class types (since C++17). The
    standard library implementations are identical to (1-2).</p>
  </blockquote>
  
  <p>I have overloaded these and wanted to call these two exclusively. When I overload these two with gcc I don't have a problem. With clang++ I get an  undefined reference to <code>operator delete(void*)</code></p>
  
  <p>Here is the code</p>
  
  <pre><code>void* operator new(long unsigned int howMuch) {
      return reinterpret_cast&lt;void*&gt;(0xdeadbeef);
  }
  
  void* operator new[](long unsigned int howMuch) {
      return reinterpret_cast&lt;void*&gt;(0xdeadbeef);
  }
  
  void operator delete(void* what, long unsigned int howmuch) {
          if(what != reinterpret_cast&lt;void*&gt;(0xdeadbeef)) __builtin_trap();
          if(howmuch != 1) __builtin_trap();
  }
  
  extern "C"
  void _start() {
      delete new char;
      asm("syscall" : : "a"(60) : ); 
  }
  </code></pre>
  
  <p>Compiled with gcc: <code>g++ -ggdb -std=c++14 -nostdlib  -fno-builtin  -fno-exceptions 1.cc</code> there is no problem and it runs fine. </p>
  
  <p>Is it possible to do this with llvm/clang?</p>