cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Fix handling of std::optional, operator* might be non const

Open KenPatrickLehrmann opened this issue 3 years ago • 0 comments

Fix handling of std::optional, operator* might be non const

Also, there was an issue in detecting string iterators, the detection was relying on the container being templates, using the '>' as part of the pattern, which is not the case with std::string for instance.

Without any change, TestSymbolDatabase::iterator would fail, while TestSymbolDatabase::iterator2 (which is the same thing but with auto instead of std::string::const_iterator) would succeed.

The changes in Library::detectContainer are a bit of a hack, I'm not very proud of them...

KenPatrickLehrmann avatar Jun 09 '22 10:06 KenPatrickLehrmann