1namespace std {
2inline namespace __1 {
3template <typename T> struct vector {
4 T& operator[](unsigned) { __builtin_verbose_trap("Bounds error", "out-of-bounds access"); }
5};
6} // namespace __1
7} // namespace std
8
9void g() {
10 std::vector<int> v;
11 v[10];
12}
13
14int main() {
15 g();
16 return 0;
17}
18

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of lldb/test/Shell/Recognizer/Inputs/verbose_trap-in-stl.cpp