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
7namespace a {class A {}; class B {}; class C {}; class D {}; class E {};}
8namespace b {
9#if defined(USING_A)
10using a::A;
11#elif defined(USING_B)
12using a::B;
13#elif defined(USING_C_D)
14using a::C;
15using a::D;
16#else
17using a::E;
18#endif
19}
20namespace 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

source code of clang-tools-extra/test/clang-tidy/infrastructure/check_clang_tidy.cpp