2

this is a follow up to this question

when using nothrow allocators the code compile with clang6.0.0 but not with gcc8.1

#include <new>

class X {
   public:
      X() noexcept { }    
   private:
      static void operator delete(void*) { }
};

int main() { 
    X* x = new(std::nothrow) X{}; 
}

demo

which compiler is right ?

Tyker
  • 2,949
  • 8
  • 20

0 Answers0