From b67822dac5f403a2d143c3f25f2d19ebcc315427 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 29 Sep 2024 18:38:37 +0200 Subject: [PATCH] std.cfg: Added support for 'std::monostate' for unusedScopedObject-check --- cfg/std.cfg | 1 + test/cfg/std.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/cfg/std.cfg b/cfg/std.cfg index 482d5e0673d..3cb938bf6b8 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -8996,6 +8996,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init std::format_error std::bad_typeid std::bad_cast + std::monostate std::bad_optional_access std::bad_expected_access std::bad_weak_ptr diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 2b4dc949cb3..05c64c08045 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #ifdef __cpp_lib_span @@ -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;