diff options
author | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2017-12-11 13:54:58 +0000 |
---|---|---|
committer | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2017-12-11 13:54:58 +0000 |
commit | 6f56d3eee85c60f19e937fa72238b5ea2dfe79bd (patch) | |
tree | fd4558878137a915cca817059edd4e013322378d /libcxx/test/std/iterators | |
parent | 291e8d924ff47fdb9a0920a15a183ca699ecd6c0 (diff) | |
download | bcm5719-llvm-6f56d3eee85c60f19e937fa72238b5ea2dfe79bd.tar.gz bcm5719-llvm-6f56d3eee85c60f19e937fa72238b5ea2dfe79bd.zip |
[libcxx] Define istream_iterator equality comparison operators out-of-line
Currently libc++ defines operator== and operator!= as friend functions in the
definition of the istream_iterator class template. Such definition has a subtle
difference from an out-of-line definition required by the C++ Standard: these
functions can only be found by argument-dependent lookup, but not by qualified
lookup.
This patch changes the definition, so that it conforms to the C++ Standard and
adds a check involving qualified lookup to the test suite.
Patch contributed by Mikhail Maltsev.
Differential Revision: https://reviews.llvm.org/D40415
llvm-svn: 320363
Diffstat (limited to 'libcxx/test/std/iterators')
-rw-r--r-- | libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp index 0bee916d50c..d1824bae6f8 100644 --- a/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp @@ -49,4 +49,7 @@ int main() assert(i4 == i4); assert(i4 == i5); + + assert(std::operator==(i1, i2)); + assert(std::operator!=(i1, i3)); } |