When compiling code that calls e.g. boost::bimap<int, int>::insert(1, 1) with GCC >=12.1.0 and strict warning flags (-Werror, -Wnull-dereference) and at least -O1, the compiler reports a potential null pointer dereference in std::less::operator(), a false positive.
"error: potential null pointer dereference [-Werror=null-dereference]
{ return __x < __y; }
~~~~^~~~~"
`#include <boost/asio.hpp>
#include <boost/bimap.hpp>
int main()
{
boost::bimap<int, int> map;
map.insert({1, 1});
return 0;
}`
When compiling code that calls e.g. boost::bimap<int, int>::insert(1, 1) with GCC >=12.1.0 and strict warning flags (-Werror, -Wnull-dereference) and at least -O1, the compiler reports a potential null pointer dereference in std::less::operator(), a false positive.
"error: potential null pointer dereference [-Werror=null-dereference]
{ return __x < __y; }
~~~~^~~~~"
`#include <boost/asio.hpp>
#include <boost/bimap.hpp>
int main()
{
boost::bimap<int, int> map;
map.insert({1, 1});
return 0;
}`