Correctly instantiate `iterator_adaptor_base` when defining `pointer_iterator`
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 14 Nov 2018 07:19:21 +0000 (07:19 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 14 Nov 2018 07:19:21 +0000 (07:19 +0000)
commitdd1a9280622d4eb2ae752d48cbc1d605e0833285
tree4491805c79fc59e5ea943d3714ffb9f896c436a5
parent2bcc9517c548bafb10025af6c871657e98262db2
Correctly instantiate `iterator_adaptor_base` when defining `pointer_iterator`

The definition of `pointer_iterator` omits what should be a `iterator_traits::<>::iterator_category` parameter from `iterator_adaptor_base`. As a result, iterators based on `pointer_iterator` always have defaulted value types and the wrong iterator category.

The definition of `pointee_iterator` just a few lines above does this correctly.

This resolves [[ https://bugs.llvm.org/show_bug.cgi?id=39617 | bug 39617 ]].

Patch by Dylan MacKenzie!

Reviewers: dblaikie

Differential Revision: https://reviews.llvm.org/D54377

llvm-svn: 346833
llvm/include/llvm/ADT/iterator.h
llvm/unittests/ADT/IteratorTest.cpp