Skip to content

Commit

Permalink
[libc++] Fix debug_less test in C++03
Browse files Browse the repository at this point in the history
We were using C++11 features but the test needs to work in C++03 too.

llvm-svn: 358433
  • Loading branch information
ldionne committed Apr 15, 2019
1 parent 8ae68f2 commit e1e1bd7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions libcxx/test/libcxx/algorithms/debug_less.pass.cpp
Expand Up @@ -236,13 +236,13 @@ void test_non_const_arg_cmp() {
}

struct ValueIterator {
using iterator_category = std::input_iterator_tag;
using value_type = size_t;
using difference_type = ptrdiff_t;
using reference = size_t;
using pointer = size_t*;
typedef std::input_iterator_tag iterator_category;
typedef size_t value_type;
typedef ptrdiff_t difference_type;
typedef size_t reference;
typedef size_t* pointer;

ValueIterator() = default;
ValueIterator() { }

reference operator*() { return 0; }
ValueIterator& operator++() { return *this; }
Expand All @@ -253,13 +253,13 @@ struct ValueIterator {

void test_value_iterator() {
// Ensure no build failures when iterators return values, not references.
assert(0 == std::lexicographical_compare(ValueIterator{}, ValueIterator{},
ValueIterator{}, ValueIterator{}));
assert(0 == std::lexicographical_compare(ValueIterator(), ValueIterator(),
ValueIterator(), ValueIterator()));
}

void test_value_categories() {
std::less<int> l;
std::__debug_less<std::less<int>> dl(l);
std::__debug_less<std::less<int> > dl(l);
int lvalue = 42;
const int const_lvalue = 101;

Expand Down

0 comments on commit e1e1bd7

Please sign in to comment.