diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index cfada1320..1bf35b727 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -3165,6 +3165,9 @@ void nullPointer_wmemcmp(wchar_t *p) #include #include +#define pred [](int i){return i==0;} + + // // // @@ -3178,23 +3181,21 @@ void stdfind(const std::list &ints1, const std::list &ints2) // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue - std::find_if(ints1.begin(), ints2.end(), [](int i){return i!=0;}); + std::find_if(ints1.begin(), ints2.end(), pred); // cppcheck-suppress mismatchingContainers - if (std::find_if(ints1.begin(), ints1.end(), [](int i){return i!=0;}) == ints2.end()) {} + if (std::find_if(ints1.begin(), ints1.end(), pred) == ints2.end()) {} // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue - std::find_if_not(ints1.begin(), ints2.end(), [](int i){return i!=0;}); + std::find_if_not(ints1.begin(), ints2.end(), pred); // cppcheck-suppress mismatchingContainers - if (std::find_if_not(ints1.begin(), ints1.end(), [](int i){return i!=0;}) == ints2.end()) {} + if (std::find_if_not(ints1.begin(), ints1.end(), pred) == ints2.end()) {} } // // // void stdallof(const std::list &ints1, const std::list &ints2) { - bool pred(int); - // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::all_of(ints1.begin(), ints2.end(), pred);