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

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-nested.cpp