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,971
  • 9
  • 21

0 Answers0