summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-05-04 10:00:21 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-05-04 10:00:21 +0200
commite62ebe21a7d2e8d20475073d9bc608658cf8365c (patch)
tree7185243b1bcce75375c30cbc2c70ce989adcae79
parentccf78e04ac9d72d7f5c6b09a17204b2dfcbfd0df (diff)
downloadglibmm-e62ebe21a7d2e8d20475073d9bc608658cf8365c.tar.gz
Glib::ustring_Iterator: Accept a warning from clang++
The fix in commit 94ab1e5359f3bd9eb8204aadea88e08f52a291d8 broke ABI. Revert the modification of ustring_Iterator. It's difficult to avoid a -Wdeprecated-copy warning from clang++ without either removing or adding ABI. Fixes #98
-rw-r--r--glib/glibmm/ustring.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h
index 8746ca6e..fcdbd3ac 100644
--- a/glib/glibmm/ustring.h
+++ b/glib/glibmm/ustring.h
@@ -198,15 +198,15 @@ public:
using reference = value_type;
using pointer = void;
+ // Warning from clang++ 14.0.0:
+ // definition of implicit copy constructor for ..... is deprecated
+ // because it has a user-declared copy assignment operator [-Wdeprecated-copy]
+ //
+ // It's difficult or impossible to avoid the warning without either removing or adding ABI.
+ // https://gitlab.gnome.org/GNOME/glibmm/-/issues/98
+
inline ustring_Iterator();
- // A std::string::iterator can be copied to a std::string::const_iterator.
- template <typename T2, typename = typename std::enable_if<
- std::is_same<std::string::const_iterator, T>::value &&
- std::is_same<std::string::iterator, T2>::value, T2>::type>
- inline ustring_Iterator(const ustring_Iterator<T2>& other)
- : pos_(other.base())
- { }
- ustring_Iterator(const ustring_Iterator& other) = default;
+ inline ustring_Iterator(const ustring_Iterator<std::string::iterator>& other);
ustring_Iterator& operator=(const ustring_Iterator& other) = default;
inline value_type operator*() const;
@@ -1170,6 +1170,12 @@ inline ustring_Iterator<T>::ustring_Iterator() : pos_()
}
template <class T>
+inline ustring_Iterator<T>::ustring_Iterator(const ustring_Iterator<std::string::iterator>& other)
+: pos_(other.base())
+{
+}
+
+template <class T>
inline typename ustring_Iterator<T>::value_type ustring_Iterator<T>::operator*() const
{
return Glib::get_unichar_from_std_iterator(pos_);