From 158ba5996218d629e8523e7872f0d2bf06d7f4b2 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 18 Feb 2024 17:29:41 +0100 Subject: [PATCH] std.cfg: Added support for std::quoted() --- cfg/std.cfg | 29 +++++++++++++++++++++++++++-- test/cfg/std.cpp | 14 ++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/cfg/std.cfg b/cfg/std.cfg index 61e0fa69675..707b51f145f 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -6428,7 +6428,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun std::istringstream& std::istringstream::get (char* s, streamsize n, char delim); stream buffer (3) std::istringstream& std::istringstream::get (streambuf& sb); std::istringstream& std::istringstream::get (streambuf& sb, char delim);--> - false @@ -6566,6 +6566,31 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun 0: + + + + + + false + + + + + + + + @@ -8303,7 +8328,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init - + false diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 4fab6bb6957..2b4aa12134a 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -53,6 +53,20 @@ #include #endif +// https://en.cppreference.com/w/cpp/io/manip/quoted +void uninitvar_std_quoted(std::stringstream &ss, const std::string &input, const char delim, const char escape) +{ + ss << std::quoted(input); + ss << std::quoted(input, delim); + ss << std::quoted(input, delim, escape); + char delimChar; + // cppcheck-suppress uninitvar + ss << std::quoted(input, delimChar); + char escapeChar; + // cppcheck-suppress uninitvar + ss << std::quoted(input, delim, escapeChar); +} + int zerodiv_ldexp() { int i = std::ldexp(0.0, 42.0);