17 lines · c
1// RUN: %check_clang_tidy %s modernize-macro-to-enum %t2 3// C requires enum values to fit into an int.4#define TOO_BIG1 1L5#define TOO_BIG2 1UL6#define TOO_BIG3 1LL7#define TOO_BIG4 1ULL8 9// C forbids comma operator in initializing expressions.10#define BAD_OP 1, 211 12#define SIZE_OK1 113#define SIZE_OK2 1U14// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: replace macro with enum [modernize-macro-to-enum]15// CHECK-MESSAGES: :[[@LINE-3]]:9: warning: macro 'SIZE_OK1' defines an integral constant; prefer an enum instead16// CHECK-MESSAGES: :[[@LINE-3]]:9: warning: macro 'SIZE_OK2' defines an integral constant; prefer an enum instead17