Index: libcxx/test/std/containers/associative/map/map.nonmember/op_compare.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/associative/map/map.nonmember/op_compare.pass.cpp @@ -0,0 +1,81 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// template +// bool operator==(const std::map& lhs, +// const std::map& rhs); +// +// template +// bool operator!=(const std::map& lhs, +// const std::map& rhs); +// +// template +// bool operator<(const std::map& lhs, +// const std::map& rhs); +// +// template +// bool operator>(const std::map& lhs, +// const std::map& rhs); +// +// template +// bool operator<=(const std::map& lhs, +// const std::map& rhs); +// +// template +// bool operator>=(const std::map& lhs, +// const std::map& rhs); + +#include +#include +#include + +#include "test_comparisons.h" + +int main(int, char**) { + typedef std::map map_type; + typedef map_type::value_type value_type; + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(2, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, true, false)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "ab")); + m2.insert(value_type(1, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "bcd")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "abc")); + m2.insert(value_type(2, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + return 0; +} Index: libcxx/test/std/containers/associative/multimap/multimap.nonmember/op_compare.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/associative/multimap/multimap.nonmember/op_compare.pass.cpp @@ -0,0 +1,90 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// template +// bool operator==(const std::multimap& lhs, +// const std::multimap& rhs); +// +// template +// bool operator!=(const std::multimap& lhs, +// const std::multimap& rhs); +// +// template +// bool operator<(const std::multimap& lhs, +// const std::multimap& rhs); +// +// template +// bool operator>(const std::multimap& lhs, +// const std::multimap& rhs); +// +// template +// bool operator<=(const std::multimap& lhs, +// const std::multimap& rhs); +// +// template +// bool operator>=(const std::multimap& lhs, +// const std::multimap& rhs); + +#include +#include +#include + +#include "test_comparisons.h" + +int main(int, char**) { + typedef std::multimap map_type; + typedef map_type::value_type value_type; + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(2, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, true, false)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "ab")); + m2.insert(value_type(1, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "bcd")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "abc")); + m2.insert(value_type(2, "abc")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + { + map_type m1, m2; + m1.insert(value_type(1, "abc")); + m2.insert(value_type(1, "abc")); + m2.insert(value_type(1, "abc")); + m2.insert(value_type(1, "bcd")); + const map_type& cm1 = m1, cm2 = m2; + assert(testComparisons6(cm1, cm2, false, true)); + } + return 0; +} Index: libcxx/test/std/containers/sequences/array/compare.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/array/compare.pass.cpp +++ libcxx/test/std/containers/sequences/array/compare.pass.cpp @@ -26,18 +26,34 @@ { { typedef std::array C; - C c1 = {1, 2, 3}; - C c2 = {1, 2, 3}; - C c3 = {3, 2, 1}; - C c4 = {1, 2, 1}; + const C c1 = {1, 2, 3}; + const C c2 = {1, 2, 3}; + const C c3 = {3, 2, 1}; + const C c4 = {1, 2, 1}; assert(testComparisons6(c1, c2, true, false)); assert(testComparisons6(c1, c3, false, true)); assert(testComparisons6(c1, c4, false, false)); } { typedef std::array C; - C c1 = {}; - C c2 = {}; + const C c1 = {}; + const C c2 = {}; + assert(testComparisons6(c1, c2, true, false)); + } + { + typedef std::array C; + const C c1 = {LessAndEqComp(1), LessAndEqComp(2), LessAndEqComp(3)}; + const C c2 = {LessAndEqComp(1), LessAndEqComp(2), LessAndEqComp(3)}; + const C c3 = {LessAndEqComp(3), LessAndEqComp(2), LessAndEqComp(1)}; + const C c4 = {LessAndEqComp(1), LessAndEqComp(2), LessAndEqComp(1)}; + assert(testComparisons6(c1, c2, true, false)); + assert(testComparisons6(c1, c3, false, true)); + assert(testComparisons6(c1, c4, false, false)); + } + { + typedef std::array C; + const C c1 = {}; + const C c2 = {}; assert(testComparisons6(c1, c2, true, false)); } Index: libcxx/test/std/containers/sequences/deque/compare.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/deque/compare.pass.cpp @@ -0,0 +1,119 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// template +// bool operator==(const std::deque& lhs, +// const std::deque& rhs); + +// template +// bool operator!=(const std::deque& lhs, +// const std::deque& rhs); + +// template +// bool operator<(const std::deque& lhs, +// const std::deque& rhs); + +// template +// bool operator<=(const std::deque& lhs, +// const std::deque& rhs); + +// template +// bool operator>(const std::deque& lhs, +// const std::deque& rhs); + +// template +// bool operator>=(const std::deque& lhs, +// const std::deque& rhs); + +#include +#include + +#include "test_comparisons.h" + +int main(int, char**) +{ + { + const std::deque d1, d2; + assert(testComparisons6(d1, d2, true, false)); + } + { + const std::deque d1(1, 1), d2(1, 1); + assert(testComparisons6(d1, d2, true, false)); + } + { + int items[3] = {1, 2, 3}; + const std::deque d1(items, items + 3); + const std::deque d2(items, items + 3); + assert(testComparisons6(d1, d2, true, false)); + } + { + const std::deque d1(1, 1), d2; + assert(testComparisons6(d1, d2, false, false)); + } + { + const std::deque d1(1, 1), d2(1, 2); + assert(testComparisons6(d1, d2, false, true)); + } + { + int items1[2] = {1, 2}; + int items2[2] = {1, 3}; + const std::deque d1(items1, items1 + 2); + const std::deque d2(items2, items2 + 2); + assert(testComparisons6(d1, d2, false, true)); + } + { + int items1[2] = {2, 2}; + int items2[2] = {1, 3}; + const std::deque d1(items1, items1 + 2); + const std::deque d2(items2, items2 + 2); + assert(testComparisons6(d1, d2, false, false)); + } + { + const std::deque d1, d2; + assert(testComparisons6(d1, d2, true, false)); + } + { + const std::deque d1(1, LessAndEqComp(1)); + const std::deque d2(1, LessAndEqComp(1)); + assert(testComparisons6(d1, d2, true, false)); + } + { + LessAndEqComp items[3] = {LessAndEqComp(1), LessAndEqComp(2), LessAndEqComp(3)}; + const std::deque d1(items, items + 3); + const std::deque d2(items, items + 3); + assert(testComparisons6(d1, d2, true, false)); + } + { + const std::deque d1(1, LessAndEqComp(1)); + const std::deque d2; + assert(testComparisons6(d1, d2, false, false)); + } + { + const std::deque d1(1, LessAndEqComp(1)); + const std::deque d2(1, LessAndEqComp(2)); + assert(testComparisons6(d1, d2, false, true)); + } + { + LessAndEqComp items1[2] = {LessAndEqComp(1), LessAndEqComp(2)}; + LessAndEqComp items2[2] = {LessAndEqComp(1), LessAndEqComp(3)}; + const std::deque d1(items1, items1 + 2); + const std::deque d2(items2, items2 + 2); + assert(testComparisons6(d1, d2, false, true)); + } + { + LessAndEqComp items1[2] = {LessAndEqComp(2), LessAndEqComp(2)}; + LessAndEqComp items2[2] = {LessAndEqComp(1), LessAndEqComp(3)}; + const std::deque d1(items1, items1 + 2); + const std::deque d2(items2, items2 + 2); + assert(testComparisons6(d1, d2, false, false)); + } + + return 0; +} Index: libcxx/test/std/containers/sequences/list/compare.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/list/compare.pass.cpp @@ -0,0 +1,117 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// template< class T, class Alloc > +// bool operator==( const std::list& lhs, +// const std::list& rhs ); + +// template< class T, class Alloc > +// bool operator!=( const std::list& lhs, +// const std::list& rhs ); + +// template< class T, class Alloc > +// bool operator<( const std::list& lhs, +// const std::list& rhs ); + +// template< class T, class Alloc > +// bool operator<=( const std::list& lhs, +// const std::list& rhs ); + +// template< class T, class Alloc > +// bool operator>( const std::list& lhs, +// const std::list& rhs ); + +// template< class T, class Alloc > +// bool operator>=( const std::list& lhs, +// const std::list& rhs ); + +#include +#include + +#include "test_comparisons.h" + +int main(int, char**) { + { + const std::list l1, l2; + assert(testComparisons6(l1, l2, true, false)); + } + { + const std::list l1(1, 1), l2(1, 1); + assert(testComparisons6(l1, l2, true, false)); + } + { + int items[3] = {1, 2, 3}; + const std::list l1(items, items + 3); + const std::list l2(items, items + 3); + assert(testComparisons6(l1, l2, true, false)); + } + { + const std::list l1(1, 1), l2; + assert(testComparisons6(l1, l2, false, false)); + } + { + const std::list l1(1, 1), l2(1, 2); + assert(testComparisons6(l1, l2, false, true)); + } + { + int items1[2] = {1, 2}; + int items2[2] = {1, 3}; + const std::list l1(items1, items1 + 2); + const std::list l2(items2, items2 + 2); + assert(testComparisons6(l1, l2, false, true)); + } + { + int items1[2] = {2, 2}; + int items2[2] = {1, 3}; + const std::list l1(items1, items1 + 2); + const std::list l2(items2, items2 + 2); + assert(testComparisons6(l1, l2, false, false)); + } + { + const std::list l1, l2; + assert(testComparisons6(l1, l2, true, false)); + } + { + const std::list l1(1, LessAndEqComp(1)); + const std::list l2(1, LessAndEqComp(1)); + assert(testComparisons6(l1, l2, true, false)); + } + { + LessAndEqComp items[3] = {LessAndEqComp(1), LessAndEqComp(2), LessAndEqComp(3)}; + const std::list l1(items, items + 3); + const std::list l2(items, items + 3); + assert(testComparisons6(l1, l2, true, false)); + } + { + const std::list l1(1, LessAndEqComp(1)); + const std::list l2; + assert(testComparisons6(l1, l2, false, false)); + } + { + const std::list l1(1, LessAndEqComp(1)); + const std::list l2(1, LessAndEqComp(2)); + assert(testComparisons6(l1, l2, false, true)); + } + { + LessAndEqComp items1[2] = {LessAndEqComp(1), LessAndEqComp(2)}; + LessAndEqComp items2[2] = {LessAndEqComp(1), LessAndEqComp(3)}; + const std::list l1(items1, items1 + 2); + const std::list l2(items2, items2 + 2); + assert(testComparisons6(l1, l2, false, true)); + } + { + LessAndEqComp items1[2] = {LessAndEqComp(2), LessAndEqComp(2)}; + LessAndEqComp items2[2] = {LessAndEqComp(1), LessAndEqComp(3)}; + const std::list l1(items1, items1 + 2); + const std::list l2(items2, items2 + 2); + assert(testComparisons6(l1, l2, false, false)); + } + return 0; +} Index: libcxx/test/std/containers/sequences/vector.bool/compare.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/vector.bool/compare.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// bool operator==( const vector& lhs, const vector& rhs ); +// bool operator!=( const vector& lhs, const vector& rhs ); +// bool operator< ( const vector& lhs, const vector& rhs ); +// bool operator<=( const vector& lhs, const vector& rhs ); +// bool operator> ( const vector& lhs, const vector& rhs ); +// bool operator>=( const vector& lhs, const vector& rhs ); + +#include +#include + +#include "test_comparisons.h" + +int main(int, char**) { + typedef std::vector VB; + { + const VB v1, v2; + assert(testComparisons6(v1, v2, true, false)); + } + { + const VB v1(1, true); + const VB v2(1, true); + assert(testComparisons6(v1, v2, true, false)); + } + { + const VB v1(1, false); + const VB v2(1, true); + assert(testComparisons6(v1, v2, false, true)); + } + { + const VB v1, v2(1, true); + assert(testComparisons6(v1, v2, false, true)); + } + { + bool items1[3] = {false, true, false}; + bool items2[3] = {false, true, true}; + const VB v1(items1, items1 + 3); + const VB v2(items2, items2 + 3); + assert(testComparisons6(v1, v2, false, true)); + } + { + bool items1[3] = {false, false, false}; + bool items2[3] = {false, true, false}; + const VB v1(items1, items1 + 3); + const VB v2(items2, items2 + 3); + assert(testComparisons6(v1, v2, false, true)); + } + { + bool items1[2] = {false, true}; + bool items2[3] = {false, true, false}; + const VB v1(items1, items1 + 2); + const VB v2(items2, items2 + 3); + assert(testComparisons6(v1, v2, false, true)); + } + { + bool items[3] = {false, true, false}; + const VB v1(items, items + 3); + const VB v2(1, true); + assert(testComparisons6(v1, v2, false, true)); + } + { + assert( (std::vector() == std::vector())); + assert(!(std::vector() != std::vector())); + assert(!(std::vector() < std::vector())); + assert( (std::vector() <= std::vector())); + assert(!(std::vector() > std::vector())); + assert( (std::vector() >= std::vector())); + } + + return 0; +} Index: libcxx/test/std/containers/unord/unord.map/eq.pass.cpp =================================================================== --- libcxx/test/std/containers/unord/unord.map/eq.pass.cpp +++ libcxx/test/std/containers/unord/unord.map/eq.pass.cpp @@ -25,6 +25,8 @@ #include "test_macros.h" #include "min_allocator.h" +#include "test_comparisons.h" + int main(int, char**) { { @@ -43,8 +45,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2; - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); } { typedef std::unordered_map C; @@ -62,8 +63,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2 = c1; - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); } { typedef std::unordered_map C; @@ -82,14 +82,32 @@ C c1(std::begin(a), std::end(a)); C c2 = c1; c2.rehash(30); - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); c2.insert(P(90, "ninety")); - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); + c1.insert(P(90, "ninety")); + assert(testComparisons2(c1, c2, true)); + } + { + typedef std::unordered_map C; + typedef std::pair P; + P a[] = + { + P(10, "ten"), + P(20, "twenty"), + P(30, "thirty"), + P(40, "forty"), + P(50, "fifty"), + P(60, "sixty"), + P(70, "seventy"), + P(80, "eighty"), + }; + C c1(std::begin(a), std::end(a)); + C c2 = c1; + assert(testComparisons2(c1, c2, true)); c1.insert(P(90, "ninety")); - assert( (c1 == c2)); - assert(!(c1 != c2)); + c2.insert(P(100, "onehundred")); + assert(testComparisons2(c1, c2, false)); } #if TEST_STD_VER >= 11 { @@ -109,8 +127,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2; - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); } { typedef std::unordered_map, std::equal_to, @@ -129,8 +146,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2 = c1; - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); } { typedef std::unordered_map, std::equal_to, @@ -150,14 +166,33 @@ C c1(std::begin(a), std::end(a)); C c2 = c1; c2.rehash(30); - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); c2.insert(P(90, "ninety")); - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); + c1.insert(P(90, "ninety")); + assert(testComparisons2(c1, c2, true)); + } + { + typedef std::unordered_map, std::equal_to, + min_allocator>> C; + typedef std::pair P; + P a[] = + { + P(10, "ten"), + P(20, "twenty"), + P(30, "thirty"), + P(40, "forty"), + P(50, "fifty"), + P(60, "sixty"), + P(70, "seventy"), + P(80, "eighty"), + }; + C c1(std::begin(a), std::end(a)); + C c2 = c1; + assert(testComparisons2(c1, c2, true)); c1.insert(P(90, "ninety")); - assert( (c1 == c2)); - assert(!(c1 != c2)); + c2.insert(P(100, "onehundred")); + assert(testComparisons2(c1, c2, false)); } #endif Index: libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp =================================================================== --- libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp +++ libcxx/test/std/containers/unord/unord.multimap/eq.pass.cpp @@ -25,6 +25,8 @@ #include "test_macros.h" #include "min_allocator.h" +#include "test_comparisons.h" + int main(int, char**) { { @@ -46,8 +48,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2; - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); } { typedef std::unordered_multimap C; @@ -68,8 +69,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2 = c1; - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); } { typedef std::unordered_multimap C; @@ -91,14 +91,35 @@ C c1(std::begin(a), std::end(a)); C c2 = c1; c2.rehash(30); - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); c2.insert(P(90, "ninety")); - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); c1.insert(P(90, "ninety")); - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); + } + { + typedef std::unordered_multimap C; + typedef std::pair P; + P a[] = + { + P(10, "ten"), + P(20, "twenty"), + P(20, "twenty 2"), + P(30, "thirty"), + P(40, "forty"), + P(50, "fifty"), + P(50, "fifty 2"), + P(50, "fifty 3"), + P(60, "sixty"), + P(70, "seventy"), + P(80, "eighty"), + }; + C c1(std::begin(a), std::end(a)); + C c2 = c1; + assert(testComparisons2(c1, c2, true)); + c1.insert(P(70, "seventy 2")); + c2.insert(P(80, "eighty 2")); + assert(testComparisons2(c1, c2, false)); } #if TEST_STD_VER >= 11 { @@ -121,8 +142,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2; - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); } { typedef std::unordered_multimap, std::equal_to, @@ -144,8 +164,7 @@ }; const C c1(std::begin(a), std::end(a)); const C c2 = c1; - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); } { typedef std::unordered_multimap, std::equal_to, @@ -168,14 +187,36 @@ C c1(std::begin(a), std::end(a)); C c2 = c1; c2.rehash(30); - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); c2.insert(P(90, "ninety")); - assert(!(c1 == c2)); - assert( (c1 != c2)); + assert(testComparisons2(c1, c2, false)); c1.insert(P(90, "ninety")); - assert( (c1 == c2)); - assert(!(c1 != c2)); + assert(testComparisons2(c1, c2, true)); + } + { + typedef std::unordered_multimap, std::equal_to, + min_allocator>> C; + typedef std::pair P; + P a[] = + { + P(10, "ten"), + P(20, "twenty"), + P(20, "twenty 2"), + P(30, "thirty"), + P(40, "forty"), + P(50, "fifty"), + P(50, "fifty 2"), + P(50, "fifty 3"), + P(60, "sixty"), + P(70, "seventy"), + P(80, "eighty"), + }; + C c1(std::begin(a), std::end(a)); + C c2 = c1; + assert(testComparisons2(c1, c2, true)); + c1.insert(P(70, "seventy 2")); + c2.insert(P(80, "eighty 2")); + assert(testComparisons2(c1, c2, false)); } #endif Index: libcxx/test/support/test_comparisons.h =================================================================== --- libcxx/test/support/test_comparisons.h +++ libcxx/test/support/test_comparisons.h @@ -176,13 +176,13 @@ struct LessAndEqComp { int value; - LessAndEqComp(int v) : value(v) {} + TEST_CONSTEXPR_CXX14 LessAndEqComp(int v) : value(v) {} - friend bool operator<(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { + friend TEST_CONSTEXPR_CXX14 bool operator<(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { return lhs.value < rhs.value; } - friend bool operator==(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { + friend TEST_CONSTEXPR_CXX14 bool operator==(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { return lhs.value == rhs.value; } };