Hi all, Jason,

in mainline, this commit:

    http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=199232

appear to have caused a diagnostic regression for the following (from c++/43906):

extern void z();
void f() { if ( z ) z(); }

that is, with -Waddress we warn twice, because in cp_convert_and_check we call cp_convert twice with the same arguments. How shall we deal with this? Something like the attached, or you have in mind something more neat, I don't know?!?

Thanks!
Paolo.

///////////////////
Index: cvt.c
===================================================================
--- cvt.c       (revision 204536)
+++ cvt.c       (working copy)
@@ -629,7 +629,8 @@ cp_convert_and_check (tree type, tree expr, tsubst
     {
       tree folded = maybe_constant_value (expr);
       tree stripped = folded;
-      tree folded_result = cp_convert (type, folded, complain);
+      tree folded_result
+       = folded != expr ? cp_convert (type, folded, complain) : result;
 
       /* maybe_constant_value wraps an INTEGER_CST with TREE_OVERFLOW in a
         NOP_EXPR so that it isn't TREE_CONSTANT anymore.  */

Reply via email to