This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug with -Woverloaded-virtual on gcc 2.951
> > > tt.cc: In instantiation of `DBType_Ord<unsigned char>':
> > > tt.cc:19: instantiated from here
> > > tt.cc:4: warning: `BaseType::operator =(const char *)' was hidden
> > > tt.cc:12: warning: by `DBType_Ord<unsigned char>::operator =(unsigned char)'
[...]
> OK, I can aggree with you that the warning should be printed. But
> what it let me think to get an error is the format, how the warning is printed.
> I don't know if it is somewhere documented, but until now the formats
> of messages from gcc where divided into warnings and errors. A warning
> was marked with
>
> ....: warning: ....
>
> and any other output was an error.
It seems your IDE does an incomplete job. Giving -Wall to compilation of
int foo()
{
}
gives the literal output
a.cc: In function `int foo()':
a.cc:3: warning: control reaches end of non-void function `foo()'
So here is another line that does not start with "warning", but still
is part of the warning. In fact, almost *every* warning is preceded by
lines that don't have "warning" inside.
The instantiation traceback (" instantiated from here") never tells
you whether a warning or an error is to follow; it is only an
indication about the true location of the problem (which might have
nothing to do with the place where the problem occurs).
I don't think the "instantiated from here" lines should be changed; it
is much more readable the way it is now.
Regards,
Martin