No matter what I try, I cannot get this code to produce any clang-tidy warnings:
#include <iostream>
#include <array>
void foo() {
std::array<int, 500> i;
int k[500];
std::cout << "hello world " << i[0] << k[0] << std::endl;
}
void bar() {
std::array<int, 1000> i;
i.fill(0xcdcdcdcd);
}
int main() {
bar();
foo();
return 0;
}
It produces this output:
hello world -842150451-842150451
I would like for clang-tidy to emit warnings that i[0]
and k[0]
are uninitialized. Is it (currently) capable of doing this?