From 06a14f8fb57d47710380c85a060e0215e7e32d22 Mon Sep 17 00:00:00 2001 From: chrchr Date: Thu, 11 Jan 2024 19:46:10 +0100 Subject: [PATCH] Add support for std::exception::what etc. --- cfg/std.cfg | 5 +++++ test/cfg/std.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/cfg/std.cfg b/cfg/std.cfg index edb76a1e4e8..753cd006ae1 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -8593,6 +8593,11 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init + + false + + + malloc calloc diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index d48817a7f31..1d2c17e8de6 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -25,6 +25,7 @@ #define __STDC_WANT_LIB_EXT1__ 1 #include #include +#include #include #include #ifndef __STDC_NO_THREADS__ @@ -924,6 +925,12 @@ void std_tie_ignoredReturnValue(int a, int b) std::tie(a, b); } +void std_exception_ignoredReturnValue(const std::exception& e) +{ + // cppcheck-suppress ignoredReturnValue + e.what(); +} + void valid_code() { std::vector vecInt{0, 1, 2};