Blame SOURCES/gdb-rhbz795424-bitpos-arrayview.patch

6240d7
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
6240d7
From: Sergio Durigan Junior <sergiodj@redhat.com>
6240d7
Date: Wed, 12 Sep 2018 00:02:17 -0400
6240d7
Subject: gdb-rhbz795424-bitpos-arrayview.patch
6240d7
6240d7
;; This patch is needed to compile GDB after -Werror=narrowing has
6240d7
;; been enabled by default.
6240d7
;; Author: Sergio Durigan Junior.
6240d7
6240d7
diff --git a/gdb/common/array-view.h b/gdb/common/array-view.h
6240d7
--- a/gdb/common/array-view.h
6240d7
+++ b/gdb/common/array-view.h
6240d7
@@ -85,7 +85,7 @@ public:
6240d7
   using value_type = T;
6240d7
   using reference = T &;
6240d7
   using const_reference = const T &;
6240d7
-  using size_type = size_t;
6240d7
+  using size_type = ULONGEST;
6240d7
 
6240d7
   /* Default construction creates an empty view.  */
6240d7
   constexpr array_view () noexcept
6240d7
@@ -114,7 +114,7 @@ public:
6240d7
      count.  */
6240d7
   template
6240d7
 	   typename = Requires<DecayedConvertible<U>>>
6240d7
-  constexpr array_view (U *array, size_t size) noexcept
6240d7
+  constexpr array_view (U *array, ULONGEST size) noexcept
6240d7
     : m_array (array), m_size (size)
6240d7
   {}
6240d7
 
6240d7
@@ -128,7 +128,7 @@ public:
6240d7
   {}
6240d7
 
6240d7
   /* Create an array view from an array.  */
6240d7
-  template
6240d7
+  template
6240d7
 	   typename = Requires<DecayedConvertible<U>>>
6240d7
   constexpr array_view (U (&array)[Size]) noexcept
6240d7
     : m_array (array), m_size (Size)
6240d7
@@ -161,9 +161,9 @@ public:
6240d7
   /*constexpr14*/ T *end () noexcept { return m_array + m_size; }
6240d7
   constexpr const T *end () const noexcept { return m_array + m_size; }
6240d7
 
6240d7
-  /*constexpr14*/ reference operator[] (size_t index) noexcept
6240d7
+  /*constexpr14*/ reference operator[] (ULONGEST index) noexcept
6240d7
   { return m_array[index]; }
6240d7
-  constexpr const_reference operator[] (size_t index) const noexcept
6240d7
+  constexpr const_reference operator[] (ULONGEST index) const noexcept
6240d7
   { return m_array[index]; }
6240d7
 
6240d7
   constexpr size_type size () const noexcept { return m_size; }
6240d7
@@ -196,7 +196,7 @@ operator== (const gdb::array_view<T> &lhs, const gdb::array_view<T> &rhs)
6240d7
   if (lhs.size () != rhs.size ())
6240d7
     return false;
6240d7
 
6240d7
-  for (size_t i = 0; i < lhs.size (); i++)
6240d7
+  for (ULONGEST i = 0; i < lhs.size (); i++)
6240d7
     if (!(lhs[i] == rhs[i]))
6240d7
       return false;
6240d7