public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/50660] warning about pass NULL to non pointer argument happens twice for template function call
Date: Fri, 07 Oct 2011 19:32:00 -0000	[thread overview]
Message-ID: <bug-50660-4-vBJ53VuE72@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50660-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50660

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-07 19:32:03 UTC ---
Something like this handles correctly the testcase and passes the testsuite,
but at the moment I don't know if we could do something else. Maybe Jason can
have a quick look...

Index: call.c
===================================================================
--- call.c    (revision 179660)
+++ call.c    (working copy)
@@ -5559,6 +5559,7 @@ convert_like_real (conversion *convs, tree expr, t
   tree totype = convs->type;
   diagnostic_t diag_kind;
   int flags;
+  int savew = warningcount;

   if (convs->bad_p && !(complain & tf_error))
     return error_mark_node;
@@ -5783,7 +5784,9 @@ convert_like_real (conversion *convs, tree expr, t

   expr = convert_like_real (convs->u.next, expr, fn, argnum,
                 convs->kind == ck_ref_bind ? -1 : 1,
-                convs->kind == ck_ref_bind ? issue_conversion_warnings :
false, 
+                convs->kind == ck_ref_bind
+                && warningcount == savew
+                ? issue_conversion_warnings : false,
                 c_cast_p,
                 complain);
   if (expr == error_mark_node)


  parent reply	other threads:[~2011-10-07 19:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07 18:10 [Bug other/50660] New: gcc repeats warnings twice toralf.foerster at gmx dot de
2011-10-07 18:17 ` [Bug other/50660] " redi at gcc dot gnu.org
2011-10-07 18:21 ` [Bug c++/50660] warning about pass NULL to non pointer argument happens twice for template function call pinskia at gcc dot gnu.org
2011-10-07 18:53 ` paolo.carlini at oracle dot com
2011-10-07 18:57 ` paolo.carlini at oracle dot com
2011-10-07 19:32 ` paolo.carlini at oracle dot com [this message]
2011-10-09 10:21 ` paolo.carlini at oracle dot com
2011-10-09 10:42 ` [Bug c++/50660] warning about pass NULL to non pointer argument happens twice paolo.carlini at oracle dot com
2011-10-11  1:29 ` paolo at gcc dot gnu.org
2011-10-11  1:30 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50660-4-vBJ53VuE72@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).