This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Strange g++ behaviour?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]