[PATCH] D107294: [clang-tidy] adds warning to suggest users replace symbols with words
Christopher Di Bella via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 3 11:36:25 PDT 2021
cjdb 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.
+//
----------------
whisperity wrote:
> This seems to be very old code, there was a licence change approx. 2 years ago.
Yikes, that's what I get for not reading what I'm copying. Should there be an NFC to go and update the other checks' licences too?
================
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 {
----------------
whisperity wrote:
> But also there is a convention for the documentation comment for the main class of checks, and the code here should adhere to that.
Not sure I'm following you here: are you suggesting I put the contents of my `rst` file in a comment here?
================
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
----------------
whisperity wrote:
> Either use plural xor singular for all of these printouts, to keep consistency.
`negation` is the plural in this case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107294/new/
https://reviews.llvm.org/D107294
More information about the cfe-commits
mailing list