diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-29 14:54:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-29 15:15:57 +0000 |
commit | 86de069171eabb17928664e54b522fcd5d201325 (patch) | |
tree | 68ce0635c03a967b10747a525164a7937c80218d | |
parent | 6c2cf4c457138e887f374157dd4bbeddc6ec567c (diff) | |
download | qtwebengine-chromium-86de069171eabb17928664e54b522fcd5d201325.tar.gz |
FIXUP: Fix building with g++ 5
Force all the constexpr BasicStringPiece constructors to be always-
inline, otherwise they will be missing at link time with debug builds.
Change-Id: Icaae32d3eefd5f7babfbac141209eefd7061ca88
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r-- | chromium/base/strings/string_piece.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/base/strings/string_piece.h b/chromium/base/strings/string_piece.h index 8cd9fa83d02..dd30802be09 100644 --- a/chromium/base/strings/string_piece.h +++ b/chromium/base/strings/string_piece.h @@ -177,7 +177,11 @@ template <typename STRING_TYPE> class BasicStringPiece { // We provide non-explicit singleton constructors so users can pass // in a "const char*" or a "string" wherever a "StringPiece" is // expected (likewise for char16, string16, StringPiece16). +#if defined(COMPILER_GCC) + constexpr BasicStringPiece() __attribute__((always_inline)) : ptr_(NULL), length_(0) {} +#else constexpr BasicStringPiece() : ptr_(NULL), length_(0) {} +#endif // TODO(dcheng): Construction from nullptr is not allowed for // std::basic_string_view, so remove the special handling for it. // Note: This doesn't just use STRING_TYPE::traits_type::length(), since that @@ -190,7 +194,11 @@ template <typename STRING_TYPE> class BasicStringPiece { : ptr_(str), length_(!str ? 0 : CharTraits<value_type>::length(str)) {} BasicStringPiece(const STRING_TYPE& str) : ptr_(str.data()), length_(str.size()) {} +#if defined(COMPILER_GCC) + constexpr BasicStringPiece(const value_type* offset, size_type len) __attribute__((always_inline)) +#else constexpr BasicStringPiece(const value_type* offset, size_type len) +#endif : ptr_(offset), length_(len) {} BasicStringPiece(const typename STRING_TYPE::const_iterator& begin, const typename STRING_TYPE::const_iterator& end) { |