public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65324] New: -Wzero-as-null-pointer-constant: incorrect location for function templates
@ 2015-03-05 10:23 akim.demaille at gmail dot com
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
0 siblings, 2 replies; 3+ messages in thread
From: akim.demaille at gmail dot com @ 2015-03-05 10:23 UTC (permalink / raw)
To: gcc-bugs
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).
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/65324] -Wzero-as-null-pointer-constant: incorrect location for function templates
2015-03-05 10:23 [Bug c++/65324] New: -Wzero-as-null-pointer-constant: incorrect location for function templates akim.demaille at gmail dot com
@ 2015-03-05 20:56 ` paolo.carlini at oracle dot com
2015-03-05 21:03 ` paolo.carlini at oracle dot com
1 sibling, 0 replies; 3+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-05 20:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Weird, I thought we already had this in Bugzilla, where I explained that it
doesn't particularly have to do with this warning, eg,
template <typename T>
void fun(T, signed char = 1000.0) {}
int main()
{
fun(0);
}
Can you please check?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/65324] -Wzero-as-null-pointer-constant: incorrect location for function templates
2015-03-05 10:23 [Bug c++/65324] New: -Wzero-as-null-pointer-constant: incorrect location for function templates akim.demaille at gmail dot com
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
1 sibling, 0 replies; 3+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-05 21:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Yes.
*** This bug has been marked as a duplicate of bug 52718 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-05 21:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 10:23 [Bug c++/65324] New: -Wzero-as-null-pointer-constant: incorrect location for function templates akim.demaille at gmail dot com
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
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).