diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-12-06 16:36:01 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-12-07 09:00:00 +0100 |
commit | 8e6865188242bccb3d8aa857ddc990d72a058d3d (patch) | |
tree | 31a19fba39c6c7f85e1561a8e73e25a6e71cb50f /config_host | |
parent | c1fbdc8717fa68f4c432511ace8b58c97b1386ad (diff) |
Adapt o3tl::span to P1872R0
..."span should have size_type, not index_type"
(<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf>), as
implemented by libc++ since <https://github.com/llvm/llvm-project/commit/
1466335cf4b2854a0be1defcf279fe50772bad6f> "[libc++][P1872] span should have
size_type, not index_type."
All uses of index_type had been added to mitigate the previous std::span change
from signed (ptrdiff_t) to unsigned (size_t) index_type, see
6ef8420fdbf8dff16de13147c5ab833bc5e01121 "Adapt o3tl::span to updated C++2a
std::span". There is no easy solution to transparently support all three
std::span variants currently out there (signed index_type, unsigned index_type,
unsigned size_type), without causing compilation failures due to
CPPUNIT_ASSERT_EQUAL with arguments of different types, or compiler warnings
about mixed signed/unsigned comparisons. So rule out the oldest std::span
variant (signed index_type) in configure.ac (so that o3tl::span will use its
own hand-rolled code in that case) and simplify the uses of index_type to
std::size_t (as had already been mentioned in
6ef8420fdbf8dff16de13147c5ab833bc5e01121).
Change-Id: I6ddf424ffb7941da3f69ad66fd29ecd35f09afae
Reviewed-on: https://gerrit.libreoffice.org/84652
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'config_host')
-rw-r--r-- | config_host/config_global.h.in | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in index adb36c39ab8b..5b04594c12f5 100644 --- a/config_host/config_global.h.in +++ b/config_host/config_global.h.in @@ -29,6 +29,9 @@ Any change in this header will cause a rebuild of almost everything. // constexpr", and <https://wg21.link/P1143R2> "Adding the constinit keyword": #define HAVE_CPP_CONSTINIT_SORTED_VECTOR 0 +// Useable C++2a <span>: +#define HAVE_CPP_SPAN 0 + /* GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87150> "move ctor wrongly chosen in return stmt (derived vs. base)": */ #define HAVE_GCC_BUG_87150 0 |