Skip to content

Commit 514d069

Browse files
authored
[clang-tidy] Fix warnings caused by "new check" template (#80537)
1 parent 260fe03 commit 514d069

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-tidy/add_new_check.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ def write_implementation(module_path, module, namespace, check_name_camel):
131131
//===----------------------------------------------------------------------===//
132132
133133
#include "%(check_name)s.h"
134-
#include "clang/AST/ASTContext.h"
135134
#include "clang/ASTMatchers/ASTMatchFinder.h"
136135
137136
using namespace clang::ast_matchers;
@@ -146,7 +145,7 @@ def write_implementation(module_path, module, namespace, check_name_camel):
146145
void %(check_name)s::check(const MatchFinder::MatchResult &Result) {
147146
// FIXME: Add callback implementation.
148147
const auto *MatchedDecl = Result.Nodes.getNodeAs<FunctionDecl>("x");
149-
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().startswith("awesome_"))
148+
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().starts_with("awesome_"))
150149
return;
151150
diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome")
152151
<< MatchedDecl

0 commit comments

Comments
 (0)