[PATCH] D58818: [clang-tidy] added cppcoreguidelines-use-raii-locks check
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 1 06:28:51 PST 2019
lebedev.ri added a comment.
+1 i was just going to comment - this needs **much** more tests.
Also, it would be really great if you could supply the differential's description.T
================
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:25
+ const auto MutexDecl = type(hasUnqualifiedDesugaredType(
+ recordType(hasDeclaration(cxxRecordDecl(hasName("::std::mutex"))))));
+ // Match expressions of type mutex or mutex pointer
----------------
This should be a config param
================
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:26
+ recordType(hasDeclaration(cxxRecordDecl(hasName("::std::mutex"))))));
+ // Match expressions of type mutex or mutex pointer
+ const auto MutexExpr =
----------------
Terminology: *this* doesn't match anything.
It's a matcher, yes, but it's just a lambda.
The actual match happens at the end.
================
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.h:13-14
+#include "../ClangTidy.h"
+#include <iostream>
+namespace clang {
+namespace tidy {
----------------
Separate with newline
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
More information about the cfe-commits
mailing list