[array] Fix a couple constexpr warnings

./subprojects/harfbuzz/src/hb-array.hh:71:25: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  constexpr hb_array_t& operator = (const hb_array_t<U> &o)
                        ^
                                                            const
../subprojects/harfbuzz/src/hb-array.hh:72:5: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
  { arrayZ = o.arrayZ; length = o.length; backwards_length = o.backwards_length; return *this; }
    ^
../subprojects/harfbuzz/src/hb-array.hh:329:32: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  constexpr hb_sorted_array_t& operator = (const hb_array_t<U> &o)
                               ^
                                                                   const
../subprojects/harfbuzz/src/hb-array.hh:330:5: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
  { hb_array_t<Type> (*this) = o; return *this; }
    ^
4 warnings generated.
This commit is contained in:
Behdad Esfahbod 2021-11-19 17:19:09 -07:00
parent 98fefd5ded
commit 325f26290e
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&>
arrayZ (o.arrayZ), length (o.length), backwards_length (o.backwards_length) {}
template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))>
constexpr hb_array_t& operator = (const hb_array_t<U> &o)
hb_array_t& operator = (const hb_array_t<U> &o)
{ arrayZ = o.arrayZ; length = o.length; backwards_length = o.backwards_length; return *this; }
/*
@ -326,7 +326,7 @@ struct hb_sorted_array_t :
hb_array_t<Type> (o) {}
template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))>
constexpr hb_sorted_array_t& operator = (const hb_array_t<U> &o)
hb_sorted_array_t& operator = (const hb_array_t<U> &o)
{ hb_array_t<Type> (*this) = o; return *this; }
/* Iterator implementation. */