[Bug libstdc++/118341] Missing -D_GLIBCXX_ASSERTIONS checks for <bitset>
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 5 18:25:02 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118341
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Myers <ncm@gcc.gnu.org>:
https://gcc.gnu.org/g:1b404c574450a48fee5f28f2acffafee7419fe38
commit r16-7919-g1b404c574450a48fee5f28f2acffafee7419fe38
Author: Nathan Myers <ncm@cantrip.org>
Date: Wed Mar 4 13:08:41 2026 -0500
libstdc++: bitset subscript check when _GLIBCXX_ASSERTIONS [PR118341]
Changes in v3:
- Delete redundant "dg" annotations.
Changes in v2:
- Rejigger testing.
- Add tests for regular bitset<>::op[].
Perform __glibcxx_assert bounds check on indices to bitset<>::op[]
for const and non-const overloads.
Also, add previously neglected regular tests for bitset<>::op[].
libstdc++-v3/ChangeLog
PR libstdc++/118341
* include/std/bitset (operator[] (2x)): Add assertion.
* testsuite/20_util/bitset/access/118341_neg1.cc: New test.
* testsuite/20_util/bitset/access/118341_neg2.cc: Same.
* testsuite/20_util/bitset/access/118341_smoke.cc: Same.
* testsuite/20_util/bitset/access/subscript.cc: Same.
* testsuite/20_util/bitset/access/subscript_const_neg.cc: Same.
More information about the Gcc-bugs
mailing list