Skip to content

[cherry-pick][-Wunsafe-buffer-usage] A new warning for uses of std::span two-param constructors (#77148) #8073

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

Merged

Conversation

ziqingluo-90
Copy link

Constructing std::span objects with the two parameter constructors could introduce mismatched bounds information, which defeats the purpose of using std::span. Therefore, we warn every use of such constructors.

rdar://115817781
(cherry picked from commit 9816863)

…arameter constructors (llvm#77148)

Constructing `std::span` objects with the two parameter constructors
could introduce mismatched bounds information, which defeats the
purpose of using `std::span`.  Therefore, we warn every use of such
constructors.

rdar://115817781
(cherry picked from commit 9816863)
Copy link

@jkorous-apple jkorous-apple left a comment

Choose a reason for hiding this comment

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

LGTM

@jkorous-apple
Copy link

@swift-ci please test

@ziqingluo-90 ziqingluo-90 merged commit 32d7841 into swiftlang:stable/20230725 Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants