Skip to content

Commit

Permalink
std.cfg: Added support for 'std::monostate' for unusedScopedObject-check
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Sep 29, 2024
1 parent 161def7 commit b67822d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions cfg/std.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8996,6 +8996,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
<check>std::format_error</check>
<check>std::bad_typeid</check>
<check>std::bad_cast</check>
<check>std::monostate</check>
<check>std::bad_optional_access</check>
<check>std::bad_expected_access</check>
<check>std::bad_weak_ptr</check>
Expand Down
7 changes: 7 additions & 0 deletions test/cfg/std.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
#include <version>
#ifdef __cpp_lib_span
Expand Down Expand Up @@ -2636,6 +2637,12 @@ void uninitvar_llround(void)
(void)std::llroundl(ld);
}

void unusedScopedObject_std_monostate(void)
{
// cppcheck-suppress unusedScopedObject
std::monostate{};
}

void uninitvar_srand(void)
{
unsigned int seed;
Expand Down

0 comments on commit b67822d

Please sign in to comment.