From 4a3242f1dc891592de402243f9eae0d5abc40492 Mon Sep 17 00:00:00 2001 From: Roger Ferrer Ibanez Date: Mon, 11 Dec 2017 13:54:58 +0000 Subject: [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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320363 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../istream.iterator/istream.iterator.ops/equal.pass.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp index 0bee916d5..d1824bae6 100644 --- a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.ops/equal.pass.cpp +++ b/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)); } -- cgit v1.2.3