gcc/testsuite/g++.dg/torture/pr118521.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-additional-options "-Wall" } |
| 3 | |
| 4 | #include <vector> // { dg-bogus "writing 1 byte into a region of size 0" "" { target *-*-* } 0 } |
| 5 | |
| 6 | void bar(std::vector<char>); |
| 7 | |
| 8 | void foo() |
| 9 | { |
| 10 | std::vector<char> v{1, 2}; |
| 11 | v.insert(v.end(), 2, 0); |
| 12 | v.push_back(1); |
| 13 | bar(v); |
| 14 | } |