Skip to content
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

<bitset>: operator[] could be SAL annotated with _In_range_(<, _Bits) #5262

Open
StephanTLavavej opened this issue Feb 1, 2025 · 0 comments
Labels
enhancement Something can be improved

Comments

@StephanTLavavej
Copy link
Member

Following array's example:

_NODISCARD _CONSTEXPR17 reference operator[](_In_range_(<, _Size) size_type _Pos) noexcept /* strengthened */ {

Found while investigating STL Hardening (#5090). I'm filing a followup issue because libcxx has tests under std/utilities/template.bitset that will emit /analyze warnings for bitset<0>. if constexpr could avoid this, but they compile their tests in older Standard modes.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

No branches or pull requests

1 participant