Files
clang-p2996/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-empty-options.cpp
Nathan James 3ed40ac90c [clang-tidy] Fixed an issue in readability-identifier-naming not using options specified.
Fixed an issue where specifying empty strings for prefix or suffix would be ignored preventing using those to override a different style.

Fixes https://github.com/llvm/llvm-project/issues/56358.

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D129070
2023-03-18 15:54:25 +00:00

13 lines
545 B
C++

// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
// RUN: -config='{CheckOptions: { \
// RUN: readability-identifier-naming.GlobalConstantPrefix: "", \
// RUN: readability-identifier-naming.GlobalVariablePrefix: g_ }}'
int BadGlobalVariable;
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'BadGlobalVariable' [readability-identifier-naming]
// CHECK-FIXES: int g_BadGlobalVariable;
int g_GoodGlobalVariable;
const int GoodGlobalConstant = 0;
const int g_IgnoreGlobalConstant = 0;