aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp b/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
index 3da1469..4a8f292 100644
--- a/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
@@ -17,8 +17,6 @@ using namespace clang::ast_matchers;
namespace clang::tidy::performance {
-namespace {
-
// Matcher names. Given the code:
//
// \code
@@ -60,12 +58,14 @@ static const char LoopInitVarName[] = "loop_init_var";
static const char LoopEndExprName[] = "loop_end_expr";
static const char RangeLoopName[] = "for_range_loop";
-ast_matchers::internal::Matcher<Expr> supportedContainerTypesMatcher() {
+static ast_matchers::internal::Matcher<Expr> supportedContainerTypesMatcher() {
return hasType(cxxRecordDecl(hasAnyName(
"::std::vector", "::std::set", "::std::unordered_set", "::std::map",
"::std::unordered_map", "::std::array", "::std::deque")));
}
+namespace {
+
AST_MATCHER(Expr, hasSideEffects) {
return Node.HasSideEffects(Finder->getASTContext());
}