| 775 | } |
| 776 | |
| 777 | void uninitvar_std_next(const std::vector<int> &v, int count) |
| 778 | { |
| 779 | // No warning shall be shown: |
| 780 | if (std::next(v.begin()) != v.end()) {} |
| 781 | if (std::next(v.begin(), count) != v.end()) {} |
| 782 | |
| 783 | std::vector<int>::iterator it; |
| 784 | // cppcheck-suppress uninitvar |
| 785 | if (std::next(it) != v.end()) {} |
| 786 | |
| 787 | std::vector<int>::const_iterator const_it; |
| 788 | // cppcheck-suppress uninitvar |
| 789 | if (std::next(const_it) != v.end()) {} |
| 790 | |
| 791 | std::vector<int>::reverse_iterator rit; |
| 792 | // cppcheck-suppress uninitvar |
| 793 | if (std::next(rit) != v.rend()) {} |
| 794 | |
| 795 | std::vector<int>::const_reverse_iterator const_rit; |
| 796 | // cppcheck-suppress uninitvar |
| 797 | if (std::next(const_rit) != v.rend()) {} |
| 798 | } |
| 799 | |
| 800 | void uninitvar_std_prev(const std::vector<int> &v, int count) |
| 801 | { |