Skip to content

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

@StephanTLavavej

Description

@StephanTLavavej

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions