Execute runformat

This commit is contained in:
Daniel Marjamäki 2023-06-10 17:37:32 +02:00
parent 24b0d08753
commit 7840bc4c63
2 changed files with 13 additions and 11 deletions

View File

@ -4724,7 +4724,7 @@ void smartPtr_get()
*p = 1;
}
void smartPtr_get2(std::vector<std::unique_ptr<int>>& v)
void smartPtr_get2(std::vector<std::unique_ptr<int>>& v)
{
for (auto& u : v) {
int* p = u.get();
@ -4751,7 +4751,7 @@ void smartPtr_release()
void std_vector_data_arithmetic()
{
std::vector<char> buf;
buf.resize(1);
memcpy(buf.data() + 0, "", 1);
std::vector<char> buf;
buf.resize(1);
memcpy(buf.data() + 0, "", 1);
}

View File

@ -1,13 +1,15 @@
namespace {
template <typename T>
T f() { return T(); }
template<typename T>
T f() {
return T();
}
}
// cppcheck-suppress unusedFunction
int g(int i) {
if (i == 0)
return f<char>();
if (i == 1)
return f<short>();
return f<int>();
if (i == 0)
return f<char>();
if (i == 1)
return f<short>();
return f<int>();
}