1 /* { dg-do compile } */
2 /* { dg-options "-Wall -O3" } */
4 typedef long unsigned int size_t;
7 fill (int *p, size_t n, int)
17 size_t size () const {
18 return size_t (p1 - p0);
21 void resize (size_t n) {
26 void append (size_t n)
28 if (size_t (p2 - p1) >= n) {
36 b.resize (b.size () - 1);
39 /* If b.size() == 0, then the argument to b.resize is -1U (it overflowed).
40 This will result calling "fill" which turns into a memset with a bogus
41 length argument. We want to make sure we warn, which multiple
42 things. First the ldist pass converted the loop into a memset,
43 cprop and simplifications made the length a constant and the static
44 analysis pass determines it's a bogus size to pass to memset. */
45 /* { dg-warning "exceeds maximum object size" "" { target *-*-* } 0 } */