Fix SafeIntIterator reference type
authorGuillaume Chatelet <gchatelet@google.com>
Mon, 6 Mar 2023 14:13:07 +0000 (14:13 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 6 Mar 2023 15:28:25 +0000 (15:28 +0000)
commitbff3682e9ede6c317bbfb666e64a7d4927ba9055
tree7029b54c26446876b3b9847abb1394201f0f99f8
parent960126e04a6faad1b71e110a4262c5733e50fab7
Fix SafeIntIterator reference type

We explicitly state that the `reference` type for Sequence iterator is a `value_type`.
Since the iterator is a lazy generator, it cannot point to any memory and so it cannot have a reference type.
Fixes https://github.com/llvm/llvm-project/issues/61122

Differential Revision: https://reviews.llvm.org/D145373
llvm/include/llvm/ADT/Sequence.h
llvm/unittests/ADT/SequenceTest.cpp