This is the mail archive of the gcc-patches@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: C++ PATCH: expressions in void context


Jason Merrill wrote:
Jason> What's wrong with rfg[45].C, that they should be changed like
that?
prepatch, cplus_expand_expr_stmt contained the following
-   if (TREE_CODE (exp) == FUNCTION_DECL)
-     {
-       cp_warning ("reference, not call, to function `%D'", exp);
-       warning ("at this point in file");
-     }
to warn about plain `fn;' this test is now moved inside convert_to_void.
Which means we spot it in more places.

When void casting a conditional, convert_to_void has to look inside each
branch -- it has to to catch erroneous overloading with no context for
instance. Ergo, the above test pops out. (another way of writing
rfg[45].C to avoid the warning would be  `i ? &f1 : &f2;')

Mark> Good question.  Nathan, perhaps I didn't make myself clear when I
Mark> looked at the patch.  I'm unahppy with the extra warnings that the
The extra warning I thought you meant was on the `&fn' variant, which
popped out on the g++.pt/explicit*.C cases. I did remove that one.

Would you still like me to remove the warning about plain `fn'? I don't
think it belongs in cplus_expand_expr_stmt.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
        I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


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