I created a simple checker that tries to check whether an iterator is possibly used outside of its valid range (it equals to end()). However, it does not work, of course, since it turned out that iterators are not symbolic but value objects. I read this information in the archive of this list. There I read two suggestions: either to implement tracking of value objects in the Clang infrastructure (very much effort needed) or to do some hacking.
However, I am curious why iterators are handled as value objects unlike other complex types. Is there a specific reason for that? Is it not possible to change this behavior? Would it break something in Clang? Where are iterators recognized and distinguished from other C++ complex types? In Clang or LLVM? What types are considered as iterators: only std:: iterators, types having suffix “iterator” in their names or types having the usual member types (the types defined in std::iterator_traits)?