www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



c++.beta - [8.50] bug: no match for function 'operator delete(Type*)'

This code does not compile in both 8.50 and 8.49 with exceptions
enabled (-Ae).

===
#include <new>

struct A {};

struct B
{
	B() {}			// *

	void* operator new(size_t, A&) {return 0;}

	void operator delete(void*, A&) {}
};

int main()
{
    A a;

	new (a) B();
}
===

The error is "no match for function 'operator delete(B*)'".

Note, that commenting line marked with * fixes the problem.
Feb 13 2007