This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-971031 strange error when deleting qualified member.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]