Debian Codegraph @

libstdc++-v3/testsuite/23_containers/vector/bool/capacity/110498.cc

raw
1 // { dg-options "-O3 -Werror=array-bounds -fno-assume-sane-operators-new-delete" }
2 // { dg-do compile }
3
4 // Bug libstdc++/110498
5 // Spurious warnings stringop-overflow and array-bounds copying data as bytes
6 // into vector::reserve
7
8 #include <vector>
9
10 void f(std::vector<bool>& v)
11 {
12 // Warning emitted when set to any number in the range [1,64].
13 const std::size_t reserve_size = 30;
14
15 v.reserve(reserve_size);
16 v.push_back(0);
17 }
18