This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: annoying warning message
- To: seefelds at MAGELLAN dot UMontreal dot CA
- Subject: Re: annoying warning message
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Wed, 15 Sep 1999 08:51:45 +0200
- CC: bug-gcc at gnu dot org
- References: <37DE91C3.5E95A15F@magellan.umontreal.ca>
> the following program produces a warning message though
> I believe it is well formed.
Yes, the program is well-formed.
> Who is right ?
Hard to say, without knowing the intentions of the omniORB authors.
g++ selects (correctly) the operator returning a Vertex&; not the
one returning a Vertex const&. It then qualification-converts that
to Vertext const&.
If that's what you want to happen, both your program and gcc are
right, and the warning is just annoying.
However, if you wanted that to call the operator returning Vertex
const&, you are wrong - thankfully, gcc warned you :-)
If you understand all of that well, and just want to get rid of the
warning, you'd have to change the compiler not to produce it. In the
mainline, this is changed as well.
Hope this helps,
Martin