[clang-tidy] ProBoundsConstantArrayIndexCheck::check - use cast<> instead of dyn_cast...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 12 Feb 2022 10:43:21 +0000 (10:43 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 12 Feb 2022 10:43:21 +0000 (10:43 +0000)
commit5bc13f9d9471adc81c8bf2b62775b6e2fd72f8e6
treeb1f08c857a83ab1e30cf02e45d74d0f7fe146a03
parent389bee71ea71bf5a36e3786d3f60d3aa62e30be3
[clang-tidy] ProBoundsConstantArrayIndexCheck::check - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp