diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-12-07 11:37:24 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-12-07 22:46:49 +0100 |
commit | 7d928d8c6eb03c4e5e0d1961e9b62718ab53fb46 (patch) | |
tree | 43e827f3debcf3cfbc2c101c10ed2043bc880d9a /include/rtl | |
parent | 74dd206e67c2efb1e56d817be9e42a1ed82e3239 (diff) |
HAVE_CXX14_CONSTEXPR is always true now
...but for safety, leave the configure.ac check in for some longer.
o3tl::array_view::max_size (include/o3tl/array_view.hxx) and
o3tl::basic_string_view::max_size (include/o3tl/string_view.hxx) started to
produce loplugin:staticmethods warnings, which I silenced by /not/ making the
functions static. Those classes are meant to be temporary drop-in replacements
for standard classes (std::span slated for C++20, prev. std::array_view; and
std::basic_string_view, resp.), so should have the same behavior as their
standard counterparts (and making the functions static would likely cause
loplugin:staticaccess warnings at call sites).
Change-Id: If21674dbf02886f453ca447544e37b184df5a25e
Reviewed-on: https://gerrit.libreoffice.org/64768
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r-- | include/rtl/stringutils.hxx | 13 | ||||
-rw-r--r-- | include/rtl/ustring.hxx | 3 |
2 files changed, 3 insertions, 13 deletions
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx index 6f3e18f9d202..ec8c88211593 100644 --- a/include/rtl/stringutils.hxx +++ b/include/rtl/stringutils.hxx @@ -16,10 +16,6 @@ #include "sal/types.h" -#if defined LIBO_INTERNAL_ONLY -#include "config_global.h" -#endif - // The unittest uses slightly different code to help check that the proper // calls are made. The class is put into a different namespace to make // sure the compiler generates a different (if generating also non-inline) @@ -157,7 +153,7 @@ struct ConstCharArrayDetector< const char[ N ], T > typedef T Type; static const std::size_t length = N - 1; static const bool ok = true; -#if defined LIBO_INTERNAL_ONLY && HAVE_CXX14_CONSTEXPR +#if defined LIBO_INTERNAL_ONLY constexpr #endif static bool isValid(char const (& literal)[N]) { @@ -183,7 +179,7 @@ struct ConstCharArrayDetector< const char[ 1 ], T > typedef T Type; static const std::size_t length = 0; static const bool ok = true; -#if defined LIBO_INTERNAL_ONLY && HAVE_CXX14_CONSTEXPR +#if defined LIBO_INTERNAL_ONLY constexpr #endif static bool isValid(char const (& literal)[1]) { @@ -202,10 +198,7 @@ struct ConstCharArrayDetector<char8_t const [N], T> { using Type = T; static constexpr bool const ok = true; static constexpr std::size_t const length = N - 1; -#if HAVE_CXX14_CONSTEXPR - constexpr -#endif - static bool isValid(char8_t const (& literal)[N]) { + static constexpr bool isValid(char8_t const (& literal)[N]) { for (std::size_t i = 0; i != N - 1; ++i) { if (literal[i] == u8'\0') { return false; diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 7ab872e9d61d..d803a1ad4e6f 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -33,7 +33,6 @@ #include "rtl/textenc.h" #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" -#include "config_global.h" #include "rtl/stringconcat.hxx" #endif @@ -79,10 +78,8 @@ struct SAL_WARN_UNUSED OUStringLiteral data( libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal)) { -#if HAVE_CXX14_CONSTEXPR assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); -#endif } int size; |