1 // { dg-do link } 2 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org> 3 // DR127: Ambiguity in description of matching deallocation function 4 5 #include <cstddef> 6 #include <new> 7 8 struct A 9 { 10 // placement new, but can be called through normal new syntax. 11 void* operator new(std::size_t size, float = 0.0f) 12 { 13 return ::operator new(size); 14 } 15 16 // The matching deallocation function must be called, which means 17 // the placemente delete. 18 void operator delete(void*); deleteA19 void operator delete(void*, float) {} 20 AA21 A() 22 { throw 5; } 23 }; 24 main()25int main() 26 { 27 (void)new A; 28 } 29