[PATCH] D54349: [clang-tidy] new check 'readability-redundant-preprocessor'

Miklos Vajna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 16 13:20:10 PST 2018


vmiklos marked 2 inline comments as done.
vmiklos added inline comments.


================
Comment at: clang-tidy/readability/RedundantPreprocessorCheck.cpp:37
+    CheckMacroRedundancy(Loc, Condition, IfStack,
+                         "nested redundant if; consider removing it",
+                         "previous if was here", true);
----------------
aaron.ballman wrote:
> I think these diagnostics should be hoisted as private constant members of the class. Something like:
> `nested redundant %select{#if|#ifdef|#ifndef}0; consider removing it"` and `previous %select{#if|#ifdef|#ifndef}0 here`
Done, I've also added an enum to specify if/ifdef/ifndef to avoid hard-to-read 0/1/2 for these.


https://reviews.llvm.org/D54349





More information about the cfe-commits mailing list