void good_erase_after_forward_list1(std::forward_list<int> &FL) { auto i2 = FL.cbegin(), i0 = i2++, i1 = i2++; FL.erase_after(i0); *i0; // no-warning *i2; // no-warning }
void bad_copy_assign_operator_forward_list1(std::forward_list<int> &FL1, const std::forward_list<int> &FL2) { auto i0 = FL1.cbegin(); FL1 = FL2; *i0; // expected-warning{{Invalidated iterator accessed}} }
void good_pop_front_forward_list1(std::forward_list<int> &FL, int n) { auto i1 = FL.cbegin(), i0 = i1++; FL.pop_front(); *i1; // no-warning }
void bad_pop_front_forward_list1(std::forward_list<int> &FL, int n) { auto i1 = FL.cbegin(), i0 = i1++; FL.pop_front(); *i0; // expected-warning{{Invalidated iterator accessed}} }
void good_emplace_front_forward_list1(std::forward_list<int> &FL, int n) { auto i0 = FL.cbegin(), i1 = FL.cend(); FL.emplace_front(n); *i0; // no-warning }