1// RUN: %check_clang_tidy %s cppcoreguidelines-init-variables,readability-isolate-declaration %t
2
3void foo() {
4 int A, B, C;
5 // CHECK-MESSAGES-DAG: :[[@LINE-1]]:7: warning: variable 'A' is not initialized
6 // CHECK-MESSAGES-DAG: :[[@LINE-2]]:10: warning: variable 'B' is not initialized
7 // CHECK-MESSAGES-DAG: :[[@LINE-3]]:13: warning: variable 'C' is not initialized
8 // CHECK-MESSAGES-DAG: :[[@LINE-4]]:3: warning: multiple declarations in a single statement reduces readability
9
10 // Only the isolate declarations fix-it should be applied
11
12 // CHECK-FIXES: int A;
13 // CHECK-FIXES-NEXT: int B;
14 // CHECK-FIXES-NEXT: int C;
15}
16

source code of clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/init-variables-conflict.cpp