1 // RUN: %check_clang_tidy %s cppcoreguidelines-macro-usage %t \ 2 // RUN: -config='{CheckOptions: \ 3 // RUN: [{key: cppcoreguidelines-macro-usage.CheckCapsOnly, value: true}]}' -- 4 5 #ifndef INCLUDE_GUARD 6 #define INCLUDE_GUARD 7 8 #define problematic_constant 0 9 // CHECK-MESSAGES: [[@LINE-1]]:9: warning: macro definition does not define the macro name 'problematic_constant' using all uppercase characters 10 11 #define problematic_function(x, y) ((a) > (b) ? (a) : (b)) 12 // CHECK-MESSAGES: [[@LINE-1]]:9: warning: macro definition does not define the macro name 'problematic_function' using all uppercase characters 13 14 #define problematic_variadic(...) (__VA_ARGS__) 15 // CHECK-MESSAGES: [[@LINE-1]]:9: warning: macro definition does not define the macro name 'problematic_variadic' using all uppercase characters 16 // 17 #define problematic_variadic2(x, ...) (__VA_ARGS__) 18 // CHECK-MESSAGES: [[@LINE-1]]:9: warning: macro definition does not define the macro name 'problematic_variadic2' using all uppercase characters 19 20 #define OKISH_CONSTANT 42 21 #define OKISH_FUNCTION(x, y) ((a) > (b) ? (a) : (b)) 22 #define OKISH_VARIADIC(...) (__VA_ARGS__) 23 24 #endif 25