From 6d3208ecb0f10f60250bf60bb32585d1ba838197 Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Wed, 11 May 2022 23:24:16 -0500 Subject: [PATCH] Fix 11062: false positive: knownEmptyContainer (regression) (#4106) * Fix 11062: false positive: knownEmptyContainer (regression) * Format --- cfg/std.cfg | 1 - test/teststl.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cfg/std.cfg b/cfg/std.cfg index cd024c437..c56b3a286 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -7765,7 +7765,6 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init - diff --git a/test/teststl.cpp b/test/teststl.cpp index 51f1613de..35f0c3888 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -5780,6 +5780,15 @@ private: "}\n", true); ASSERT_EQUALS("", errout.str()); + + check("extern void f(std::string&&);\n" + "static void func() {\n" + " std::string s;\n" + " const std::string& s_ref = s;\n" + " f(std::move(s));\n" + "}\n", + true); + ASSERT_EQUALS("", errout.str()); } void checkMutexes() {