[PATCH] D29692: [clang-tidy] add check modernize-use-const-instead-of-define
Malcolm Parsons via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 8 02:37:05 PST 2017
malcolm.parsons added inline comments.
================
Comment at: clang-tidy/modernize/UseConstInsteadOfDefineCheck.cpp:20
+namespace {
+class MacroParenthesesPPCallbacks : public PPCallbacks {
+public:
----------------
s/MacroParentheses/ConstantValues/ ?
================
Comment at: docs/clang-tidy/checks/modernize-use-const-instead-of-define.rst:11
+
+voif defineSeven() {
+ #define X 7
----------------
s/voif/void/
Why is this in a function anyway?
================
Comment at: test/clang-tidy/modernize-use-const-instead-of-define.cpp:3
+
+// allthough there might be cases where the - sign is actually used those
+// should be rare enough. e.g. int a = 5 BAD1;
----------------
s/allthough/Although/
================
Comment at: test/clang-tidy/modernize-use-const-instead-of-define.cpp:6
+#define BAD1 -1
+// CHECK-MESSAGES: :[[@LINE-1]]:{{.*}} [modernize-use-const-instead-of-define]
+#define BAD2 2
----------------
Check the message?
Repository:
rL LLVM
https://reviews.llvm.org/D29692
More information about the cfe-commits
mailing list