xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/branch-clone-unknown-expr.cpp (revision a65a3bffd31f57243929b0f50abbd90bd626faee)
1 // RUN: %check_clang_tidy -expect-clang-tidy-error %s bugprone-branch-clone %t
2 
test_unknown_expression()3 int test_unknown_expression() {
4   if (unknown_expression_1) {        // CHECK-MESSAGES: :[[@LINE]]:7: error: use of undeclared identifier 'unknown_expression_1' [clang-diagnostic-error]
5     function1(unknown_expression_2); // CHECK-MESSAGES: :[[@LINE]]:15: error: use of undeclared identifier 'unknown_expression_2' [clang-diagnostic-error]
6   } else {
7     function2(unknown_expression_3); // CHECK-MESSAGES: :[[@LINE]]:15: error: use of undeclared identifier 'unknown_expression_3' [clang-diagnostic-error]
8   }
9 }
10