================
@@ -123,19 +143,28 @@ void
UseScopedLockCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
void UseScopedLockCheck::registerMatchers(MatchFinder *Finder) {
const auto LockGuardClassDecl =
namedDecl(hasName("lock_guard"), isInStdNamespace());
+ const auto ScopedLockClassDecl =
+ namedDecl(hasName("scoped_lock"), isInStdNamespace());
+ const auto LockClassDecl = anyOf(LockGuardClassDecl, ScopedLockClassDecl);
const auto LockGuardType =
qualType(anyOf(hasUnqualifiedDesugaredType(
recordType(hasDeclaration(LockGuardClassDecl))),
hasUnqualifiedDesugaredType(templateSpecializationType(
hasDeclaration(LockGuardClassDecl)))));
- const auto LockVarDecl = varDecl(hasType(LockGuardType));
+ const auto LockType = qualType(anyOf(
+ hasUnqualifiedDesugaredType(recordType(hasDeclaration(LockClassDecl))),
+ hasUnqualifiedDesugaredType(
+ templateSpecializationType(hasDeclaration(LockClassDecl)))));
----------------
zwuis wrote:
```cpp
qualType(hasUnqualifiedDesugaredType(mapAnyOf(recordType,
templateSpecializationType).with(hasDeclaration(LockClassDecl))))
```
https://github.com/llvm/llvm-project/pull/209272
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits