public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65323] New: -Wzero-as-null-pointer-constant stutters
@ 2015-03-05 10:12 akim.demaille at gmail dot com
  2015-03-05 20:57 ` [Bug c++/65323] " paolo.carlini at oracle dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: akim.demaille at gmail dot com @ 2015-03-05 10:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65323

            Bug ID: 65323
           Summary: -Wzero-as-null-pointer-constant stutters
           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

While tracking a spurious warning about at 0 instead of nullptr, I stumbled on
the following case, where g++ is spitting its warning too many times (4.9 and
5).

struct foo
{
  foo(void* = 0)  {}
  void fun(void* = 0) {}
  void* p = 0;
};

int main()
{
  foo f;
  f.fun();
}


g++-mp-5 -std=c++14 -Wzero-as-null-pointer-constant foo.cc 
foo.cc:3:15: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
   foo(void* = 0)  {}
               ^
foo.cc:3:15: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
foo.cc:4:20: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
   void fun(void* = 0) {}
                    ^
foo.cc:4:20: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
foo.cc:5:13: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
   void* p = 0;
             ^


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-12 23:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 10:12 [Bug c++/65323] New: -Wzero-as-null-pointer-constant stutters akim.demaille at gmail dot com
2015-03-05 20:57 ` [Bug c++/65323] " paolo.carlini at oracle dot com
2015-03-05 21:04 ` paolo.carlini at oracle dot com
2015-03-06  0:17 ` [Bug c++/65323] [4.8/4.9/5 Regression] duplicate -Wzero-as-null-pointer-constant warnings paolo.carlini at oracle dot com
2015-03-09 14:43 ` rguenth at gcc dot gnu.org
2015-03-10 14:50 ` ktietz at gcc dot gnu.org
2015-03-10 15:24 ` paolo.carlini at oracle dot com
2015-03-12 23:56 ` paolo at gcc dot gnu.org
2015-03-12 23:58 ` [Bug c++/65323] [4.8/4.9 " 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).