This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for better diagnostic (was: Re: Bug in MI?)
On , 6 March 1998, 07:55:30, oliva@dcc.unicamp.br wrote:
> Manfred Hollstein writes:
>
> > - else cp_error (" since type `%T' has abstract virtual functions", type);
> > + else
> > + {
> > + if (u == error_mark_node)
> > + cp_error (" since type `%T' has virtual functions", type);
>
> how about: ............... must override virtual functions
>
> > + else
> > + cp_error (" since type `%T' has abstract virtual functions", type);
> > + }
> > }
>
> It would be even better if we could list those functions...
Actually, they are listed (abstract_virtuals_error from cp/typeck2.c):
/* Only go through this once. */
if (TREE_PURPOSE (u) == NULL_TREE)
{
/* In class.c:override_one_vtable we might have marked this as a
class with abstract methods; in fact, it is a class with
virtual base classes for which not all virtual methods
have been overridden. */
if (u == error_mark_node)
error (" since the following virtual functions are not finally overridden:");
else
error (" since the following virtual functions are abstract:");
TREE_PURPOSE (u) = error_mark_node;
while (u)
{
cp_error ("\t%#D", TREE_VALUE (u));
u = TREE_CHAIN (u);
}
}
else
{
if (u == error_mark_node)
cp_error (" since type `%T' has virtual functions", type);
else
cp_error (" since type `%T' has abstract virtual functions", type);
}
But only once for each error.
manfred