public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "akim.demaille at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65324] New: -Wzero-as-null-pointer-constant: incorrect location for function templates Date: Thu, 05 Mar 2015 10:23:00 -0000 [thread overview] Message-ID: <bug-65324-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324 Bug ID: 65324 Summary: -Wzero-as-null-pointer-constant: incorrect location for function templates Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: akim.demaille at gmail dot com template <typename T> void fun(T, void* = 0) {} int main() { fun(0); } g++-mp-5 -O3 -Wzero-as-null-pointer-constant foo.cc foo.cc: In function 'void fun(T, void*) [with T = int]': foo.cc:6:8: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant] fun(0); ^ foo.cc:6:8: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant] This is annoying, because it breaks the usefulness of -isystem: Boost still has places where they use 0 instead of nullptr, in particular in template functions with default arguments. This triggers warnings in my own code, instead of in the library (well, actually, I expect to have none at all in my case, since I use -isystem). Thanks! (And please, note that it stutters too, as in #65323).
next reply other threads:[~2015-03-05 10:23 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-05 10:23 akim.demaille at gmail dot com [this message] 2015-03-05 20:56 ` [Bug c++/65324] " paolo.carlini at oracle dot com 2015-03-05 21:03 ` 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-65324-4@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: linkBe 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).