#include <new>
#include <cstdlib>
class X
{
protected:
static void* operator new(size_t sz);
static void operator delete(void* p) noexcept;
};
class Y : public X { }; // inheritance is ok
class Z { X x; }; // ok
X x1; // ok
int main()
{
X x2; // ok
Y y1; // ok
X* xp = new X; // syntax error
Y* yp = new Y; // syntax error
delete xp; // syntax error
delete yp; // syntax error
};
I2luY2x1ZGUgPG5ldz4KI2luY2x1ZGUgPGNzdGRsaWI+CgpjbGFzcyBYCnsKcHJvdGVjdGVkOgogIHN0YXRpYyB2b2lkKiBvcGVyYXRvciBuZXcoc2l6ZV90IHN6KTsKICBzdGF0aWMgdm9pZCAgb3BlcmF0b3IgZGVsZXRlKHZvaWQqIHApIG5vZXhjZXB0Owp9OwoKY2xhc3MgWSA6IHB1YmxpYyBYIHsgfTsgIC8vIGluaGVyaXRhbmNlIGlzIG9rCmNsYXNzIFogeyBYIHg7IH07ICAgICAgICAvLyBvawoKWCB4MTsgICAgICAgICAgICAgICAgICAgIC8vIG9rCmludCBtYWluKCkKewogIFggeDI7ICAgICAgICAgICAgICAgICAgLy8gb2sKICBZIHkxOyAgICAgICAgICAgICAgICAgIC8vIG9rCiAgWCogeHAgPSBuZXcgWDsgICAgICAgICAvLyBzeW50YXggZXJyb3IKICBZKiB5cCA9IG5ldyBZOyAgICAgICAgIC8vIHN5bnRheCBlcnJvcgoKICBkZWxldGUgeHA7ICAgICAgICAgICAgIC8vIHN5bnRheCBlcnJvcgogIGRlbGV0ZSB5cDsgICAgICAgICAgICAgLy8gc3ludGF4IGVycm9yCn07