| 1 | // RUN: %check_clang_tidy %s readability-uppercase-literal-suffix %t -- \ |
| 2 | // RUN: -config="{CheckOptions: {readability-uppercase-literal-suffix.IgnoreMacros: false}}" \ |
| 3 | // RUN: -- -I %S |
| 4 | |
| 5 | void macros() { |
| 6 | #define INMACRO(X) 1.f |
| 7 | static constexpr auto m1 = INMACRO(); |
| 8 | // CHECK-NOTES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase |
| 9 | // CHECK-NOTES: :[[@LINE-3]]:20: note: expanded from macro 'INMACRO' |
| 10 | // CHECK-FIXES: #define INMACRO(X) 1.f |
| 11 | // CHECK-FIXES: static constexpr auto m1 = INMACRO(); |
| 12 | // ^ so no fix-its here. |
| 13 | } |
| 14 | |
| 15 | void horrible_macros() { |
| 16 | #define MAKE_UNSIGNED(x) x##u |
| 17 | #define ONE MAKE_UNSIGNED(1) |
| 18 | static constexpr auto hm0 = ONE; |
| 19 | // CHECK-NOTES: :[[@LINE-1]]:31: warning: integer literal has suffix 'u', which is not uppercase |
| 20 | // CHECK-NOTES: :[[@LINE-3]]:13: note: expanded from macro 'ONE' |
| 21 | // CHECK-NOTES: :[[@LINE-5]]:26: note: expanded from macro 'MAKE_UNSIGNED' |
| 22 | // CHECK-NOTES: note: expanded from here |
| 23 | // CHECK-FIXES: #define MAKE_UNSIGNED(x) x##u |
| 24 | // CHECK-FIXES: #define ONE MAKE_UNSIGNED(1) |
| 25 | // CHECK-FIXES: static constexpr auto hm0 = ONE; |
| 26 | // Certainly no fix-its. |
| 27 | } |
| 28 | |