Add static_asserts to tuple's comparison operators to enforce the requirement that the tuples be the same size. See PR39183 for an example where we give unexpected results for this bad input case. With this change, we will reject it at compile-time

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353450 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/tuple b/include/tuple
index 15cbf26..f7e7ee1 100644
--- a/include/tuple
+++ b/include/tuple
@@ -1120,6 +1120,7 @@
 bool
 operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
 {
+    static_assert (sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes");
     return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
 }
 
@@ -1163,6 +1164,7 @@
 bool
 operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
 {
+    static_assert (sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes");
     return __tuple_less<sizeof...(_Tp)>()(__x, __y);
 }