1 | // RUN: %check_clang_tidy -std=c++17-or-later %s misc-unused-using-decls %t -- --fix-notes -- -fno-delayed-template-parsing |
2 | |
3 | namespace ns { |
4 | |
5 | template <typename T> class Foo { |
6 | public: |
7 | Foo(T); |
8 | }; |
9 | // Deduction guide (CTAD) |
10 | template <typename T> Foo(T t) -> Foo<T>; |
11 | |
12 | template <typename T> class Bar { |
13 | public: |
14 | Bar(T); |
15 | }; |
16 | |
17 | template <typename T> class Unused {}; |
18 | |
19 | } // namespace ns |
20 | |
21 | using ns::Bar; |
22 | using ns::Foo; |
23 | using ns::Unused; // Unused |
24 | // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: using decl 'Unused' is unused |
25 | // CHECK-FIXES: {{^}}// Unused |
26 | |
27 | void f() { |
28 | Foo(123); |
29 | Bar(1); |
30 | } |
31 | |