================
@@ -15,30 +15,27 @@ using namespace clang::ast_matchers;
namespace clang::tidy::readability {
-static constexpr char KDefaultTypes[] =
+static constexpr char DefaultTypes[] =
"::std::basic_string;::std::basic_string_view;::std::vector;::std::array;::"
"std::span";
SimplifySubscriptExprCheck::SimplifySubscriptExprCheck(
StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context), Types(utils::options::parseStringList(
- Options.get("Types", KDefaultTypes)))
{
-}
+ Options.get("Types", DefaultTypes)))
{}
void SimplifySubscriptExprCheck::registerMatchers(MatchFinder *Finder) {
const auto TypesMatcher = hasUnqualifiedDesugaredType(
recordType(hasDeclaration(cxxRecordDecl(hasAnyName(Types)))));
Finder->addMatcher(
- arraySubscriptExpr(hasBase(
- cxxMemberCallExpr(
- has(memberExpr().bind("member")),
- on(hasType(qualType(
- unless(anyOf(substTemplateTypeParmType(),
- hasDescendant(substTemplateTypeParmType()))),
----------------
localspook wrote:
My best guess is that these checks predate `IgnoreUnlessSpelledInSource`
traversal, and this was how they emulated it back then
https://github.com/llvm/llvm-project/pull/185570
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits