1 /* Verify we do not devirtualize wrongly to __cxa_pure_virtual */
4 /* { dg-options "-O2 -std=c++11" } */
7 inline void* operator new(__SIZE_TYPE__ s, void* buf) throw() {
16 virtual Base *Clone(void *buf) const = 0;
17 virtual float *Allocate(__SIZE_TYPE__ count) = 0;
22 Base *Clone(void* buf) const override {
23 return new (buf) Value();
26 float *Allocate(__SIZE_TYPE__ count) override {
27 return new float[count];
33 new (buffer_) Value();
36 other.ptr()->Clone(buffer_);
40 return ptr()->Allocate(100);
42 const Base *ptr() const { return reinterpret_cast<const Base*>(buffer_);}
43 Base *ptr() { return reinterpret_cast< Base*>(buffer_);}
46 alignas(16) char buffer_[1024];
51 B (const A& a) : a_(a) {
52 buff_ = a_.Allocate();
63 struct D : public Dummy {
64 __attribute__((noinline)) D( const A&a);
69 D::D(const A&a) : b_(a) {}