23 lines · cpp
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 macros5#define CONCAT(a, b) a##b6void ConstNotVisible(CONCAT(cons, t) int i);7// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: parameter 'i'8// We warn, but we can't give a fix9// CHECK-FIXES: void ConstNotVisible(CONCAT(cons, t) int i);10 11#define CONST_INT_PARAM const int i12void ConstInMacro(CONST_INT_PARAM);13// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: parameter 'i'14// We warn, but we can't give a fix15// CHECK-FIXES: void ConstInMacro(CONST_INT_PARAM);16 17#define DECLARE_FUNCTION_WITH_ARG(x) struct InsideMacro{ x }18DECLARE_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