[PATCH] D29692: [clang-tidy] add check modernize-use-const-instead-of-define

Alexander Lanin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 14:29:41 PST 2017


AlexanderLanin marked 5 inline comments as done.
AlexanderLanin added inline comments.


================
Comment at: clang-tidy/modernize/UseConstInsteadOfDefineCheck.cpp:86
+    else if (isAnyParenthesis(Tok) || isAnyNumericLiteral(Tok) ||
+             (!hasPrefix && isAnyCharLiteral(Tok))) {
+      // prefix shall not be accepted anymore after any number
----------------
aaron.ballman wrote:
> What about string literals? e.g., `#define NAME "foobar"`
Excluded (for now) due to string concatenation done by preprocessor when you write NAME1 NAME2 in your code. I've added a section into modernize-use-const-instead-of-define.rst to explain this.


https://reviews.llvm.org/D29692





More information about the cfe-commits mailing list