| 1 | // RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- \ |
| 2 | // RUN: -config="{CheckOptions: {modernize-use-scoped-lock.WarnOnUsingAndTypedef: false}}" \ |
| 3 | // RUN: -- -isystem %clang_tidy_headers -fno-delayed-template-parsing |
| 4 | |
| 5 | #include <mutex> |
| 6 | |
| 7 | template <typename T> |
| 8 | using Lock = std::lock_guard<T>; |
| 9 | |
| 10 | using LockM = std::lock_guard<std::mutex>; |
| 11 | |
| 12 | typedef std::lock_guard<std::mutex> LockDef; |
| 13 | |
| 14 | void PositiveUsingDecl() { |
| 15 | using std::lock_guard; |
| 16 | |
| 17 | using LockMFun = std::lock_guard<std::mutex>; |
| 18 | |
| 19 | typedef std::lock_guard<std::mutex> LockDefFun; |
| 20 | } |
| 21 | |
| 22 | template <typename T> |
| 23 | void PositiveUsingDeclTemplate() { |
| 24 | using std::lock_guard; |
| 25 | |
| 26 | using LockFunT = std::lock_guard<T>; |
| 27 | |
| 28 | using LockMFunT = std::lock_guard<std::mutex>; |
| 29 | |
| 30 | typedef std::lock_guard<std::mutex> LockDefFunT; |
| 31 | } |
| 32 | |