[PATCH] D117522: [clang-tidy] Add modernize-macro-to-enum check

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 6 09:12:39 PST 2022


carlosgalvezp added a comment.

Ok, thanks for the explanation! I'm mostly interested on the warning message, we've had situations before where the warning describes the problem **and** the solution, which can easily lead to confusion. From the tests I can see the message is quite generic "use an enum", so it won't push users to prefer one variant over the other.

I'd like to play a bit with the patch and see what pops in our codebase but somehow I get an error when downloading, do you happen to know what could be wrong? Alternatively if there's any other easy way to checkout the patch and test it :)

  $ arc patch D117522
   Exception 
  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
  (Run with `--trace` for a full exception trace.)



> This check is more about implementing Enum.1 Prefer enumerations over macros.

Should a `cppcoreguidelines` alias be added in that case?


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

https://reviews.llvm.org/D117522



More information about the cfe-commits mailing list