Skip to content

Commit

Permalink
[clang-tidy] Fix warnings caused by "new check" template (#80537)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny committed Feb 3, 2024
1 parent 260fe03 commit 514d069
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clang-tools-extra/clang-tidy/add_new_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def write_implementation(module_path, module, namespace, check_name_camel):
//===----------------------------------------------------------------------===//
#include "%(check_name)s.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
using namespace clang::ast_matchers;
Expand All @@ -146,7 +145,7 @@ def write_implementation(module_path, module, namespace, check_name_camel):
void %(check_name)s::check(const MatchFinder::MatchResult &Result) {
// FIXME: Add callback implementation.
const auto *MatchedDecl = Result.Nodes.getNodeAs<FunctionDecl>("x");
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().startswith("awesome_"))
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().starts_with("awesome_"))
return;
diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome")
<< MatchedDecl
Expand Down

0 comments on commit 514d069

Please sign in to comment.