Strange g++ behaviour?

Alexandre Oliva aoliva@redhat.com
Thu Jul 27 14:26:00 GMT 2000


On Jul 27, 2000, David Howells <David.Howells@nexor.co.uk> wrote:

>  g++query.cpp:20: warning: choosing `comptr_t<int>::operator int *()' over `comptr_t<int>::operator bool() const'
>  g++query.cpp:20: warning:   for conversion from `pint' to `bool'

> Why is g++ reluctant to use the "operator bool() const" method?

You've already got the answer:

>  g++query.cpp:20: warning:   because conversion sequence for the argument is better

> And does it really need to give the warning message?

Nope, it's just that too many people ask this question, so we put the
answer in a warning message.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-bugs mailing list