[clang-tools-extra] Fix #75687: add std::span to the default types. (PR #76116)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 20 18:01:32 PST 2023
https://github.com/Da-Viper created https://github.com/llvm/llvm-project/pull/76116
Fixes #75687
>From 746ee1451cb96a5a320ff2bfbed62c3ad21e7345 Mon Sep 17 00:00:00 2001
From: Ezike Ebuka <yerimyah1 at gmail.com>
Date: Thu, 21 Dec 2023 01:59:29 +0000
Subject: [PATCH] Fix #75687: add std::span to the default types.
---
.../clang-tidy/readability/SimplifySubscriptExprCheck.cpp | 3 ++-
.../clang-tidy/checks/readability/simplify-subscript-expr.rst | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp b/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
index d274abcbfabe8a..7d4698d27ed160 100644
--- a/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
@@ -16,7 +16,8 @@ using namespace clang::ast_matchers;
namespace clang::tidy::readability {
static const char KDefaultTypes[] =
- "::std::basic_string;::std::basic_string_view;::std::vector;::std::array";
+ "::std::basic_string;::std::basic_string_view;::std::vector;::std::array;::"
+ "std::span";
SimplifySubscriptExprCheck::SimplifySubscriptExprCheck(
StringRef Name, ClangTidyContext *Context)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-subscript-expr.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-subscript-expr.rst
index f3f44bedcf74c5..4b7d7f2ddcf417 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-subscript-expr.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/simplify-subscript-expr.rst
@@ -20,4 +20,4 @@ Options
.. option:: Types
The list of type(s) that triggers this check. Default is
- `::std::basic_string;::std::basic_string_view;::std::vector;::std::array`
+ `::std::basic_string;::std::basic_string_view;::std::vector;::std::array;::std::span`
More information about the cfe-commits
mailing list