clang-tidy
clang-tidy is part of the LLVM project, and can identify programming errors and suggest improvements to code.
Here’s an example using it on our array code:
clang-tidy test_array.cpp -checks=-*,bugprone-*,misc-*,modernize-*,performance-*,readibility-* -- test_array.cpp