[PATCH] D114197: [clang-tidy] Fix false positives involving type aliases in `misc-unconventional-assign-operator` check

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 26 05:03:22 PST 2021


whisperity added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-unconventional-assign-operator.cpp:151
+  using Alias3 = TemplateTypeAlias<U>;
+  Alias3<T> &operator=(int) { return *this; }
+};
----------------
This is a no-warn due to the parameter being a completely unrelated type, right? Might worth a comment. I don't see at first glance why a warning should not happen here.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-unconventional-assign-operator.cpp:152
+  Alias3<T> &operator=(int) { return *this; }
+};
----------------
What about `Alias3<TypeAlias::Alias>& operator =(const Alias1&) { return *this; }`? That should trigger a warning as it is an unrelated type, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114197



More information about the cfe-commits mailing list