brintos

brintos / llvm-project-archived public Read only

0
0
Text · 642 B · 4d67feb Raw
16 lines · cpp
1// RUN: %check_clang_tidy %s cppcoreguidelines-init-variables,readability-isolate-declaration %t2 3void foo() {4  int A, B, C;5  // CHECK-MESSAGES-DAG: :[[@LINE-1]]:7: warning: variable 'A' is not initialized6  // CHECK-MESSAGES-DAG: :[[@LINE-2]]:10: warning: variable 'B' is not initialized7  // CHECK-MESSAGES-DAG: :[[@LINE-3]]:13: warning: variable 'C' is not initialized8  // CHECK-MESSAGES-DAG: :[[@LINE-4]]:3: warning: multiple declarations in a single statement reduces readability9 10  // Only the isolate declarations fix-it should be applied11 12  //      CHECK-FIXES: int A;13  // CHECK-FIXES-NEXT: int B;14  // CHECK-FIXES-NEXT: int C;15}16