https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82039
Bug ID: 82039
Summary: -Wzero-as-null-pointer-constant triggers when calling
std::allocate<...>::allocate
Product: gcc
Version: 7.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: max at maxbruckner dot de
Target Milestone: ---
Created attachment 42087
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42087&action=edit
Code to reproduce the problem
gcc 7.1.1 emits a warning when enabling -Wzero-as-null-pointer-constant and
calling the allocate member function of std::allocator provided by libstdc++.
This only happens when calling allocate with only one parameter. So a
workaround is calling it with the second parameter set to nullptr.
I think this is due to the default parameter for the second parameter being a 0
instead of nullptr (not sure though, since I couldn't find the actual
implementation in the header files.