[PATCH] D124500: [clang-tidy] Support expressions of literals in modernize-macro-to-enum

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 8 19:38:28 PDT 2022


LegalizeAdulthood marked 2 inline comments as done.
LegalizeAdulthood added a comment.

OK, so thinking about this review a little more, I propose this:

- Take the check as is, but document that the initializing expressions may result in an invalid enum, particularly for C which restricts the underlying type to be `int`
- Create a subsequent commit that rejects the enums where the language is C and the initializing expression is a value larger than an `int` by rejecting any macro where any integer token in the expression is larger than an `int`
- Create an additional subsequent commit that not only matches the expression but also computes the value and checks it for range.

How does that sound?


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

https://reviews.llvm.org/D124500



More information about the cfe-commits mailing list