[clang-doc] populateParentNamespaces - use cast<> instead of dyn_cast<> to avoid...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 12 Feb 2022 11:28:50 +0000 (11:28 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 12 Feb 2022 11:28:50 +0000 (11:28 +0000)
commit2188e61691ad89e27583fd3a4197322be830df59
tree885c3963cb1fb06e374a0e90841449d33546d547
parentfbe0ca576d2b96c523182200529b5afbf709506f
[clang-doc] populateParentNamespaces - 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

It's only later iterations of the loop where the getParent() call might return nullptr
clang-tools-extra/clang-doc/Serialize.cpp