This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70808] New: Spurious -Wzero-as-null-pointer-constant for nullptr_t
- From: "lucdanton at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Apr 2016 15:46:52 +0000
- Subject: [Bug c++/70808] New: Spurious -Wzero-as-null-pointer-constant for nullptr_t
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70808
Bug ID: 70808
Summary: Spurious -Wzero-as-null-pointer-constant for nullptr_t
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: lucdanton at free dot fr
Target Milestone: ---
The following program emits a warning when compiled with
-Wzero-as-null-pointer-constant:
int main()
{
int* no_warn = {};
// main.cpp:5:33: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
decltype( nullptr ) warn = {};
}
Unless I'm mistaken, this is not intended as demonstrated by the innocuous
no_warn variable.
Happens on a variety of versions, e.g. 5.3.1 and 6, as well as multiple -std
settings, e.g. c++11 and c++1z.