Kudos to Christophe who brought up MISRA C++ rule "An array passed as a function argument shall not decay to a pointer", which led me to find that clang-tidy and Microsoft have already implemented this check.
> clang-tidy f.cpp -checks=-*,cppcoreguidelines-pro-bounds-array-to-pointer-decay -- -std=c++20
65 warnings and 1 error generated.
B:\f.cpp:25:13: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
25 | PrintArray(arr);
| ^
Suppressed 64 warnings (64 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
and Visual Studio