Private operator delete triggers compile-time error with GCC and Clang but not with MSVC
问题 Motivated by this not very well asked duplicate, I believe the problem deserves a new standalone clearly titled question. The following code triggers a compilation error with GCC 8.1.0 and Clang 6.0.0, but not with MSVC 19.00: class X { public: X() /* noexcept */ { } private: static void operator delete(void*) { } }; int main() { X* x = new X{}; } From expr.new: If any part of the object initialization described above terminates by throwing an exception and a suitable deallocation function