mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 00:06:06 +00:00
[clang-tidy] Fix warnings caused by "new check" template (#80537)
This commit is contained in:
parent
260fe032c2
commit
514d0691f4
@ -131,7 +131,6 @@ def write_implementation(module_path, module, namespace, check_name_camel):
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "%(check_name)s.h"
|
#include "%(check_name)s.h"
|
||||||
#include "clang/AST/ASTContext.h"
|
|
||||||
#include "clang/ASTMatchers/ASTMatchFinder.h"
|
#include "clang/ASTMatchers/ASTMatchFinder.h"
|
||||||
|
|
||||||
using namespace clang::ast_matchers;
|
using namespace clang::ast_matchers;
|
||||||
@ -146,7 +145,7 @@ void %(check_name)s::registerMatchers(MatchFinder *Finder) {
|
|||||||
void %(check_name)s::check(const MatchFinder::MatchResult &Result) {
|
void %(check_name)s::check(const MatchFinder::MatchResult &Result) {
|
||||||
// FIXME: Add callback implementation.
|
// FIXME: Add callback implementation.
|
||||||
const auto *MatchedDecl = Result.Nodes.getNodeAs<FunctionDecl>("x");
|
const auto *MatchedDecl = Result.Nodes.getNodeAs<FunctionDecl>("x");
|
||||||
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().startswith("awesome_"))
|
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().starts_with("awesome_"))
|
||||||
return;
|
return;
|
||||||
diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome")
|
diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome")
|
||||||
<< MatchedDecl
|
<< MatchedDecl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user