From 55724ceb7bdd4a46047b1e291075bd6efa51dff3 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:00:56 +0200 Subject: [PATCH] Update std.cpp --- test/cfg/std.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index e2fc85ab95a..362013fb499 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -5159,3 +5159,11 @@ int passedByValue_std_bitset2(std::bitset<256> bs) { return bs.size(); } + +struct S_std_as_const { // #12974 + // cppcheck-suppress functionConst + void f() { + for (const auto& i : std::as_const(l)) {} + } + std::list l; +};