boostorg / boostorg/bimap

Null pointer dereference error in boost::bimap::insert() with strict gcc compiler warnings

Open
#53 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
26
Forks
49
PR merge metrics
No merged PRs in 30d

Description

When compiling code that calls e.g. boost::bimap::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
#include

int main()
{
boost::bimap map;
**map.insert({1, 1});**

return 0;
}`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.