egcs-971031 strange error when deleting qualified member.

Schoder, Markus Markus.Schoder@dresdner-bank.de
Tue Nov 4 02:36:00 GMT 1997


Compiling the following program (x.cpp) yields:

class Cl1
{
public:
	char  *c;

	Cl1();
	void  f1();
};

Cl1::Cl1()
{
	c = new char;
}


void Cl1::f1()
{
	delete Cl1::c;
}



$ g++ -c x.cpp
x.cpp: In method `void Cl1::f1()':
x.cpp:18: type `char * Cl1::*' argument given to `delete', expected
pointer
                       ^^^^^^
                       this looks weird

Is this correct behaviour?

Bye
Markus



More information about the Gcc mailing list