Invalid operand 'unknown type' on pure virtual methods

Alexandre Oliva oliva@lsd.ic.unicamp.br
Mon Feb 7 03:40:00 GMT 2000


On Feb  7, 2000, "Emmanuel Millon" <emmanuel.millon@voila.fr> wrote:

> class A { public: virtual void Test() = 0; };

> int main(int argc, char *argv[])
> {
>      A *a1,*a2;
[snip]
>      bool test = a1->Test==a2->Test; // I'm getting the error here!!!

Yup, this construct is ill-formed.  The only way to form a pointer to
member is by applying `&' to a qualified name, for example,
`&A::Test'.  In any case, the result of the comparison would always be
true.

> Is there a special flag to disable this error?

Nope.

> (runs on CodeWarrior, Visual C++...)

Time to submit bug reports to their maintainers :-)

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them



More information about the Gcc-bugs mailing list