namespace clang {
namespace tidy {
+namespace misc {
ArgumentCommentCheck::ArgumentCommentCheck(StringRef Name,
ClangTidyContext *Context)
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Checks that argument comments match parameter names.
class ArgumentCommentCheck : public ClangTidyCheck {
llvm::ArrayRef<const Expr *> Args);
};
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
void AssignOperatorSignatureCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Finds declarations of assign operators with the wrong return and/or
/// argument types.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
} // namespace ast_matchers
namespace tidy {
+namespace misc {
void BoolPointerImplicitConversion::registerMatchers(MatchFinder *Finder) {
// Look for ifs that have an implicit bool* to bool conversion in the
<< FixItHint::CreateInsertion(Var->getLocStart(), "*");
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Checks for conditions based on implicit conversion from a bool
/// pointer to bool e.g.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) {
const auto CheckForEndCall = hasArgument(
<< Hint;
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Checks for inaccurate use of \c erase() method.
///
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
static bool areTypesCompatible(QualType Left, QualType Right) {
if (const auto *LeftRefType = Left->getAs<ReferenceType>())
<< Hint;
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Warns on inefficient use of STL algorithms on associative containers.
///
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
class MiscModule : public ClangTidyModule {
public:
}
};
+} // namespace misc
+
// Register the MiscTidyModule using this statically initialized variable.
-static ClangTidyModuleRegistry::Add<MiscModule>
+static ClangTidyModuleRegistry::Add<misc::MiscModule>
X("misc-module", "Adds miscellaneous lint checks.");
// This anchor is used to force the linker to link in the generated object file
namespace clang {
namespace tidy {
+namespace misc {
void SwappedArgumentsCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(callExpr().bind("call"), this);
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Finds potentially swapped arguments by looking at implicit
/// conversions.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SWAPPED_ARGUMENTS_CHECK_H
-
} // namespace ast_matchers
namespace tidy {
+namespace misc {
void UndelegatedConstructorCheck::registerMatchers(MatchFinder *Finder) {
// We look for calls to constructors of the same type in constructors. To do
"A temporary object is created here instead");
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Finds creation of temporary objects in constructors that look like a
/// function call to another constructor of the same class. The user most likely
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
void UniqueptrResetRelease::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
CharSourceRange::getTokenRange(ResetCall->getSourceRange()), NewText);
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Find and replace unique_ptr::reset(release()) with std::move
///
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
} // namespace ast_matchers
namespace tidy {
+namespace misc {
void UnusedRAIICheck::registerMatchers(MatchFinder *Finder) {
// Look for temporaries that are constructed in-place and immediately
Replacement);
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Finds temporaries that look like RAII objects.
///
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
void UseOverride::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(methodDecl(isOverride()).bind("method"), this);
}
}
+} // namespace misc
} // namespace tidy
} // namespace clang
namespace clang {
namespace tidy {
+namespace misc {
/// \brief Use C++11's 'override' and remove 'virtual' where applicable.
class UseOverride : public ClangTidyCheck {
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
+} // namespace misc
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_USE_OVERRIDE_H
-
namespace tidy {
namespace test {
+using misc::ArgumentCommentCheck;
+
TEST(ArgumentCommentCheckTest, CorrectComments) {
EXPECT_NO_CHANGES(ArgumentCommentCheck,
"void f(int x, int y); void g() { f(/*x=*/0, /*y=*/0); }");