aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.
LGTM with a testing request. I agree that the Clang AST is a bit surprising, but not so surprising that I could definitely call it a bug. ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp:286-299 +// https://bugs.llvm.org/show_bug.cgi?id=44499 +class Foo; +template <int a> +bool operator!=(Foo &, Foo &) { + class Bar { + Bar &operator=(const Bar &other) { + if (this != &other) { ---------------- Thank you for this! Can you also add a test case where the diagnostic should trigger? e.g., ``` class Foo; template <int a> bool operator!=(Foo &, Foo &) { class Bar { Bar &operator=(const Bar &other) { p = other.p; return *this; } int *p; }; } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76990/new/ https://reviews.llvm.org/D76990 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits