denik added a comment. Thanks for adding a check! Please check my 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) { ---------------- Check `getAsCXXRecordDecl()` for null and add a test case. ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/standalone-empty.cpp:61 + +int test_member_empty() { + std::vector<int> s; ---------------- I think you also need `no-warning` test cases when the empty() result is used. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128372/new/ https://reviews.llvm.org/D128372 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits