aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/span
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-01-09 10:45:31 +0000
committerJonathan Wakely <jwakely@redhat.com>2023-01-10 10:09:21 +0000
commitb39f4333d18cc58b1a655c537a78fefe95b82609 (patch)
tree0515ba30fa8f71bc24cc69f752f17a932a45f0ed /libstdc++-v3/include/std/span
parent0333892db367b2b97b1ab9d3702b16f3f9e92ec3 (diff)
downloadgcc-b39f4333d18cc58b1a655c537a78fefe95b82609.zip
gcc-b39f4333d18cc58b1a655c537a78fefe95b82609.tar.gz
gcc-b39f4333d18cc58b1a655c537a78fefe95b82609.tar.bz2
libstdc++: Fix std::span constraint for sizeof(size_t) < sizeof(int) [PR108221]
The default constructor has a constraint that is always false if arithmetic on size_t values promotes to int. Rewrite the constraint exactly as written in the standard, which works correctly. libstdc++-v3/ChangeLog: PR libstdc++/108221 * include/std/span (span::span()): Un-simplify constraint to work for size_t of lesser rank than int.
Diffstat (limited to 'libstdc++-v3/include/std/span')
-rw-r--r--libstdc++-v3/include/std/span2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span
index 251fed9..b336332 100644
--- a/libstdc++-v3/include/std/span
+++ b/libstdc++-v3/include/std/span
@@ -145,7 +145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr
span() noexcept
- requires ((_Extent + 1u) <= 1u)
+ requires (_Extent == dynamic_extent || _Extent == 0)
: _M_ptr(nullptr), _M_extent(0)
{ }