Skip to content

Commit

Permalink
Update std.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored May 2, 2024
1 parent 9af0cbc commit e01aaaf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/cfg/std.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5028,3 +5028,16 @@ void assertWithSideEffect_std_map_at(const std::map<int, int>& m) // #12695
// cppcheck-suppress checkLibraryNoReturn
assert(m.at(0));
}

void assertWithSideEffect_std_unique_ptr_get((std::unique_ptr<int>& p)
{
// cppcheck-suppress checkLibraryNoReturn
assert(p.get());
}

void assertWithSideEffect_std_begin(const std::vector<std::string>& v) {
// cppcheck-suppress [checkLibraryNoReturn, checkLibraryFunction] // TODO
assert(std::is_sorted(std::begin(v), std::end(v), [](const std::string& a, const std::string& b) {
return a.size() < b.size();
}));
}

0 comments on commit e01aaaf

Please sign in to comment.