[PATCH] D128372: [Clang-Tidy] Empty Check

Christopher Di Bella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 14:41:50 PDT 2022


cjdb added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp:76
+
+    auto Methods = Arg->getType()->getAsCXXRecordDecl()->methods();
+    auto Clear = llvm::find_if(Methods, [](const CXXMethodDecl *F) {
----------------
denik wrote:
> Check `getAsCXXRecordDecl()` for null and add a test case.
We should also have a test to ensure `empty(0)` doesn't segfault.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128372



More information about the cfe-commits mailing list