[PATCH] D107294: [clang-tidy] adds warning to suggest users replace symbols with words

Whisperity via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 01:54:32 PDT 2021


whisperity added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/UseAlternativeTokensCheck.h:5-6
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
----------------
This seems to be very old code, there was a licence change approx. 2 years ago.


================
Comment at: clang-tools-extra/clang-tidy/readability/UseAlternativeTokensCheck.h:20-22
+// Flags uses of symbol-based bitwise and logical operators.
+
+class UseAlternativeTokensCheck : public ClangTidyCheck {
----------------
But also there is a convention for the documentation comment for the main class of checks, and the code here should adhere to that.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-use-alternative-tokens.rst:14
+
+This check doesn't yet account for program composition.
+
----------------
What does this refer to? Perhaps a code example and a clearly indicated //Limitations// heading would be more clear to indicate whether someone would want to enable this check.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-use-alternative-tokens.rst:21-27
+  // warning: use 'bitand' for bitwise conjunctions
+  x & y
+
+  // warning: use 'bitor' for bitwise disjunctions
+  x | y
+
+  // warning: use 'compl' for bitwise negation
----------------
Either use plural xor singular for all of these printouts, to keep consistency.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107294



More information about the llvm-commits mailing list