2 // { dg-do link { target c++11 } }
4 void* operator new(decltype(sizeof(1)), void* p) { return p; }
6 struct IndirectReturn {
8 // Undefined so we get a link error if the indirect return value is copied
9 IndirectReturn(const IndirectReturn&);
10 IndirectReturn& operator=(const IndirectReturn&) = delete;
14 IndirectReturn foo() { return IndirectReturn(); }
17 new (ptr) IndirectReturn(foo());
20 alignas (alignof (IndirectReturn))
21 unsigned char c[sizeof(IndirectReturn)];