File tree Expand file tree Collapse file tree
universal/include/userver/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,16 @@ class span final { // NOLINT(readability-identifier-naming)
3535 constexpr span () noexcept : span(nullptr , nullptr ) {}
3636
3737 constexpr span (T* begin, T* end) noexcept : begin_(begin), end_(end) {
38- UASSERT ((begin != nullptr && end != nullptr && begin <= end) || (begin == nullptr && end == nullptr ));
38+ // GCC 11.4.0 has issues with comparing pointers at compile time.
39+ UASSERT (
40+ std::is_constant_evaluated () || (begin != nullptr && end != nullptr && begin <= end) ||
41+ (begin == nullptr && end == nullptr )
42+ );
3943 }
4044
4145 constexpr span (T* begin, std::size_t size) noexcept : begin_(begin), end_(begin + size) {
42- UASSERT (begin != nullptr || size == 0 );
46+ // GCC 11.4.0 has issues with comparing pointers at compile time.
47+ UASSERT (std::is_constant_evaluated () || begin != nullptr || size == 0 );
4348 }
4449
4550#if defined(__GNUC__) && !defined(__clang__)
You can’t perform that action at this time.
0 commit comments