1 | // RUN: %check_clang_tidy -check-suffix=USING-A %s misc-unused-using-decls %t -- -- -DUSING_A |
2 | // RUN: %check_clang_tidy -check-suffix=USING-B %s misc-unused-using-decls %t -- -- -DUSING_B |
3 | // RUN: %check_clang_tidy -check-suffix=USING-C,USING-D %s misc-unused-using-decls %t -- -- -DUSING_C_D |
4 | // RUN: %check_clang_tidy -check-suffixes=USING-C,USING-D %s misc-unused-using-decls %t -- -- -DUSING_C_D |
5 | // RUN: %check_clang_tidy %s misc-unused-using-decls %t |
6 | |
7 | namespace a {class A {}; class B {}; class C {}; class D {}; class E {};} |
8 | namespace b { |
9 | #if defined(USING_A) |
10 | using a::A; |
11 | #elif defined(USING_B) |
12 | using a::B; |
13 | #elif defined(USING_C_D) |
14 | using a::C; |
15 | using a::D; |
16 | #else |
17 | using a::E; |
18 | #endif |
19 | } |
20 | namespace c {} |
21 | // CHECK-MESSAGES-USING-A: warning: using decl 'A' {{.*}} |
22 | // CHECK-MESSAGES-USING-B: warning: using decl 'B' {{.*}} |
23 | // CHECK-MESSAGES-USING-C: warning: using decl 'C' {{.*}} |
24 | // CHECK-MESSAGES-USING-D: warning: using decl 'D' {{.*}} |
25 | // CHECK-MESSAGES: warning: using decl 'E' {{.*}} |
26 | // CHECK-FIXES-USING-A-NOT: using a::A;$ |
27 | // CHECK-FIXES-USING-B-NOT: using a::B;$ |
28 | // CHECK-FIXES-USING-C-NOT: using a::C;$ |
29 | // CHECK-FIXES-USING-C-NOT: using a::D;$ |
30 | // CHECK-FIXES-USING-D-NOT: using a::C;$ |
31 | // CHECK-FIXES-USING-D-NOT: using a::D;$ |
32 | // CHECK-FIXES-NOT: using a::E;$ |
33 | |