1 | // RUN: %check_clang_tidy %s readability-avoid-const-params-in-decls %t -- \ |
2 | // RUN: -config="{CheckOptions: {readability-avoid-const-params-in-decls.IgnoreMacros: false}}" |
3 | |
4 | // Regression tests involving macros |
5 | #define CONCAT(a, b) a##b |
6 | void ConstNotVisible(CONCAT(cons, t) int i); |
7 | // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: parameter 'i' |
8 | // We warn, but we can't give a fix |
9 | // CHECK-FIXES: void ConstNotVisible(CONCAT(cons, t) int i); |
10 | |
11 | #define CONST_INT_PARAM const int i |
12 | void ConstInMacro(CONST_INT_PARAM); |
13 | // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: parameter 'i' |
14 | // We warn, but we can't give a fix |
15 | // CHECK-FIXES: void ConstInMacro(CONST_INT_PARAM); |
16 | |
17 | #define DECLARE_FUNCTION_WITH_ARG(x) struct InsideMacro{ x } |
18 | DECLARE_FUNCTION_WITH_ARG( |
19 | void member_function(const int i); |
20 | ); |
21 | // CHECK-MESSAGES: :[[@LINE-2]]:26: warning: parameter 'i' |
22 | // CHECK-FIXES: void member_function(int i); |
23 | |