Skip to content

Fix #75687: add std::span to the default types. #76116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

da-viper
Copy link
Contributor

Fixes #75687

@llvmbot
Copy link
Member

llvmbot commented Dec 21, 2023

@llvm/pr-subscribers-clang-tidy

Author: None (Da-Viper)

Changes

Fixes #75687


Full diff: https://github.com/llvm/llvm-project/pull/76116.diff

2 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/readability/simplify-subscript-expr.rst (+1-1)
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`

Copy link
Member

@PiotrZSL PiotrZSL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, please add entry in release notes.

@EugeneZelenko
Copy link
Contributor

Should Release Notes be updated?

@PiotrZSL PiotrZSL merged commit 8c24422 into llvm:main Dec 25, 2023
PiotrZSL added a commit that referenced this pull request Dec 25, 2023
…ipt-expr

Add release notes and mention ::std::span in documentation.
Change is related to #76116.
@da-viper da-viper deleted the #75687_readability-simplify-subscript_include_span branch March 20, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

readability-simplify-subscript-expr.Types should include std::span
4 participants