libstdc++: Fix std::indirectly_readable ambiguity [LWG 3446]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 Aug 2020 15:18:31 +0000 (16:18 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 24 Aug 2020 15:18:31 +0000 (16:18 +0100)
commit186aa6304570e15065f31482e9c27326a3a6679f
tree9726032613a819a32cec62c008965ac022ff64da
parenta0e6f05d26d286f5a73007e425b109f0d327e15f
libstdc++: Fix std::indirectly_readable ambiguity [LWG 3446]

This implements the proposed resolution of LWG 3446. I'm also adding
another new constrained specialization which isn't proposed by 3446, to
resolve the ambiguity when a type has both value_type and element_type
but denoting different types.

libstdc++-v3/ChangeLog:

* include/bits/iterator_concepts.h (indirectly_readable): Add
partial specializations to resolve ambiguities (LWG 3446).
* testsuite/24_iterators/associated_types/readable.traits.cc:
Check types with both value_type and element_type.
libstdc++-v3/include/bits/iterator_concepts.h
libstdc++-v3/testsuite/24_iterators/associated_types/readable.traits.cc