strange behaviour of g++
Alexandre Oliva
oliva@dcc.unicamp.br
Mon Feb 9 10:33:00 GMT 1998
Peter Schmid writes:
> While building tccs the compiler says:
> call of overloaded `fatal(char[30], const char *&, const char *&)'
> is ambiguous.
That must be because the call is ambiguous, actually :-)
> void fatal(const char *fmt, ...) const;
> void fatal(bool doperror, const char *fmt, ...) const;
> void TccsBase::mein(const char *option, bool readonly, const char *argument)
> fatal("invalid umask value (%s = %s)", option, argument);
Although the first argument is an exact match for the first version of
method fatal, and it is a boolean conversion for the second, the
second argument is an ellipsis conversion for the first version,
whereas it is an exact match for the second. Hence, none of the
implementations of `fatal' is best, therefore, the call is ambiguous.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc-bugs
mailing list