[clang-tidy] Enhance modernize-macro-to-enum to recognize constant literal expressions #55055
Closed
Description
Consider the following code:
#define TIF_CZ_LSMINFO 34412 /* 0x866c, Type: TIF_BYTE, Length: 512 */
#define TIF_CZ_LSMINFO_SIZE_RESERVED 90 + 6
#define TIF_CZ_LSMINFO_SIZE 512The first and third of these macros will be converted to enums, but the second macro will be left in place because it uses a constant integral expression as the value of the macro instead of a simple integral literal.
Enhance modernize-macro-to-enum to recognize macro expansions that are valid initializing expressions for enums. For this issue, only consider macro expansions that are expressions involving integral literals only.
Activity