[PATCH] D158671: [NFC][Clang] Fix static analyzer concerns

Daniel Grumberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 00:58:00 PDT 2023


dang accepted this revision.
dang added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/include/clang/ExtractAPI/ExtractAPIVisitor.h:195
     SymbolReference Context;
-    auto Record = dyn_cast<RecordDecl>(Decl->getDeclContext());
+    auto Record = cast<RecordDecl>(Decl->getDeclContext());
     Context.Name = Record->getName();
----------------
NIT: It's not immediately obvious that the check `if (Decl->isStaticDataMember())` guarantees that `Decl->getDeclContext()` is a `RecordDecl`. Would you mind adding a comment static that?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158671/new/

https://reviews.llvm.org/D158671



More information about the cfe-commits mailing list