diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-11-11 19:14:03 -0800 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-11-12 20:37:36 -0800 |
commit | 75c86c9935925f841c1c4e0396b701210358489a (patch) | |
tree | a565dee01229faaa9dc7ae6e29f324a1d88c1b5a /llvm/unittests/Support/ErrorTest.cpp | |
parent | 3129b3339ce133650b460a7e6b7199111f97bb4c (diff) | |
download | llvm-75c86c9935925f841c1c4e0396b701210358489a.zip llvm-75c86c9935925f841c1c4e0396b701210358489a.tar.gz llvm-75c86c9935925f841c1c4e0396b701210358489a.tar.bz2 |
Support: Make VarStreamArrayIterator iterate over const values
VarStreamArrayIterator returns a reference to a just-computed internal
value. Change it to iterate over `const ValueType` to avoid allowing
clients to mutate the internal state, and to drop the
non-`const`-qualified operator*().
The removed operator*() was from 175d70ee5c2f03f6 to get
iterator_facade_base::operator->() working, and this fixes the root
cause instead: setting `T` to `const ValueType` causes
iterator_facade_base to infer `PointerT` as `const ValueType*`.
Ironically, this is the last blocker for removing the const-incorrect
overload of `iterator_facade_base::operator->()`, whose presence
triggered adding the workaround in the first place :).
Differential Revision: https://reviews.llvm.org/D113797
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
0 files changed, 0 insertions, 0 deletions