From 02588f7a04c7c36449bf4563139887357194e7b8 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Sun, 22 Jul 2018 00:02:34 -0700 Subject: [PATCH] Bug 1481097 - xpcom: Remove nsTString literal string workaround for gcc 4.9 bug. r=nika This gcc 4.9 workaround (from bug 1377351) is no longer needed because Firefox currently requires gcc 6.1 or later (as of bug 1444274). MozReview-Commit-ID: 9R14BDzWEoj --HG-- extra : rebase_source : a56ec3ee321cdc76e704fe33c2c4a5b85b558889 extra : source : e0c26ec11d499058e51bc2c3d06b2e1840e77f13 --- xpcom/string/nsTString.h | 32 -------------------------------- xpcom/string/nsTStringRepr.h | 2 -- xpcom/string/nsTSubstring.cpp | 8 -------- xpcom/string/nsTSubstring.h | 14 -------------- 4 files changed, 56 deletions(-) diff --git a/xpcom/string/nsTString.h b/xpcom/string/nsTString.h index b1deecb76c41..9d1a83fc0070 100644 --- a/xpcom/string/nsTString.h +++ b/xpcom/string/nsTString.h @@ -38,8 +38,6 @@ public: typedef typename nsTSubstring::substring_type substring_type; #endif - typedef typename substring_type::literalstring_type literalstring_type; - typedef typename substring_type::fallible_t fallible_t; typedef typename substring_type::char_type char_type; @@ -123,15 +121,6 @@ public: this->Assign(std::move(aReadable)); } - // NOTE(nika): gcc 4.9 workaround. Remove when support is dropped. - explicit - nsTString(const literalstring_type& aReadable) - : substring_type(ClassFlags::NULL_TERMINATED) - { - this->Assign(aReadable); - } - - // |operator=| does not inherit, so we must define our own self_type& operator=(char_type aChar) { @@ -171,12 +160,6 @@ public: this->Assign(std::move(aStr)); return *this; } - // NOTE(nika): gcc 4.9 workaround. Remove when support is dropped. - self_type& operator=(const literalstring_type& aStr) - { - this->Assign(aStr); - return *this; - } self_type& operator=(const substring_tuple_type& aTuple) { this->Assign(aTuple); @@ -570,7 +553,6 @@ public: typedef typename base_string_type::substring_type substring_type; typedef typename base_string_type::size_type size_type; typedef typename base_string_type::substring_tuple_type substring_tuple_type; - typedef typename base_string_type::literalstring_type literalstring_type; // These are only for internal use within the string classes: typedef typename base_string_type::DataFlags DataFlags; @@ -640,14 +622,6 @@ public: this->Assign(std::move(aStr)); } - // NOTE(nika): gcc 4.9 workaround. Remove when support is dropped. - explicit - nsTAutoStringN(const literalstring_type& aStr) - : self_type() - { - this->Assign(aStr); - } - MOZ_IMPLICIT nsTAutoStringN(const substring_tuple_type& aTuple) : self_type() { @@ -693,12 +667,6 @@ public: this->Assign(std::move(aStr)); return *this; } - // NOTE(nika): gcc 4.9 workaround. Remove when support is dropped. - self_type& operator=(const literalstring_type& aStr) - { - this->Assign(aStr); - return *this; - } self_type& operator=(const substring_tuple_type& aTuple) { this->Assign(aTuple); diff --git a/xpcom/string/nsTStringRepr.h b/xpcom/string/nsTStringRepr.h index af51a913c1b1..a4ef7142f44a 100644 --- a/xpcom/string/nsTStringRepr.h +++ b/xpcom/string/nsTStringRepr.h @@ -15,7 +15,6 @@ #include "nsCharTraits.h" template class nsTSubstringTuple; -template class nsTLiteralString; // The base for string comparators template class nsTStringComparator @@ -107,7 +106,6 @@ public: typedef nsTSubstring substring_type; typedef nsTSubstringTuple substring_tuple_type; - typedef nsTLiteralString literalstring_type; typedef nsReadingIterator const_iterator; typedef nsWritingIterator iterator; diff --git a/xpcom/string/nsTSubstring.cpp b/xpcom/string/nsTSubstring.cpp index f1be69efbba2..31228e2bdeff 100644 --- a/xpcom/string/nsTSubstring.cpp +++ b/xpcom/string/nsTSubstring.cpp @@ -532,14 +532,6 @@ nsTSubstring::Assign(self_type&& aStr, const fallible_t& aFallible) return true; } -// NOTE(nika): gcc 4.9 workaround. Remove when support is dropped. -template -void -nsTSubstring::Assign(const literalstring_type& aStr) -{ - Assign(aStr.AsString()); -} - template void nsTSubstring::Assign(const substring_tuple_type& aTuple) diff --git a/xpcom/string/nsTSubstring.h b/xpcom/string/nsTSubstring.h index 8e730b9c262d..9f876ce8fdc8 100644 --- a/xpcom/string/nsTSubstring.h +++ b/xpcom/string/nsTSubstring.h @@ -46,7 +46,6 @@ public: typedef typename mozilla::detail::nsTStringRepr base_string_type; typedef typename base_string_type::substring_type substring_type; - typedef typename base_string_type::literalstring_type literalstring_type; typedef typename base_string_type::fallible_t fallible_t; @@ -188,13 +187,6 @@ public: void NS_FASTCALL Assign(self_type&&); MOZ_MUST_USE bool NS_FASTCALL Assign(self_type&&, const fallible_t&); - // XXX(nika): GCC 4.9 doesn't correctly resolve calls to Assign a - // nsLiteralCString into a nsTSubstring, due to a frontend bug. This explcit - // Assign overload (and the corresponding constructor and operator= overloads) - // are used to avoid this bug. Once we stop supporting GCC 4.9 we can remove - // them. - void NS_FASTCALL Assign(const literalstring_type&); - void NS_FASTCALL Assign(const substring_tuple_type&); MOZ_MUST_USE bool NS_FASTCALL Assign(const substring_tuple_type&, const fallible_t&); @@ -284,12 +276,6 @@ public: Assign(std::move(aStr)); return *this; } - // NOTE(nika): gcc 4.9 workaround. Remove when support is dropped. - self_type& operator=(const literalstring_type& aStr) - { - Assign(aStr); - return *this; - } self_type& operator=(const substring_tuple_type& aTuple) { Assign(aTuple);