llvm-project/libcxx/test/std/containers/views
Louis Dionne 0a0e0afaa0 [libc++] span: Fix incorrect static asserts
The static asserts in span<T, N>::front() and span<T, N>::back() are
incorrect as they may be triggered from valid code due to evaluation
of a never taken branch:

    span<int, 0> foo;
    if (!foo.empty()) {
        auto x = foo.front();
    }

The problem is that the branch is always evaluated by the compiler,
creating invalid compile errors for span<T, 0>.

Thanks to Michael Schellenberger Costa for the patch.

Differential Revision: https://reviews.llvm.org/D71995
2020-02-14 14:32:41 +01:00
..
span.cons [libcxx][test] Fix span tests. 2020-01-08 00:28:15 -08:00
span.elem [libc++] span: Fix incorrect static asserts 2020-02-14 14:32:41 +01:00
span.iterators [libc++][P1872] span should have size_type, not index_type. 2019-11-14 09:07:05 -05:00
span.objectrep [libcxx][test] Fix span tests. 2020-01-08 00:28:15 -08:00
span.obs [libc++][P1872] span should have size_type, not index_type. 2019-11-14 09:07:05 -05:00
span.sub [libc++] span: Guard against overflow in span::subspan 2020-02-12 16:21:46 +01:00
span.tuple [libcxx][test] Fix span tests. 2020-01-08 00:28:15 -08:00
types.pass.cpp [libc++][P1872] span should have size_type, not index_type. 2019-11-14 09:07:05 -05:00