[libcxx-commits] [libcxx] [libc++][ranges] `elements_view`: `get()` forward declarations - tests (PR #82323)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 14 23:29:55 PDT 2024


================
@@ -58,6 +61,25 @@ TEST_CONSTEXPR_CXX14 bool tests()
         assert(std::get<2>(tempArray(1, 2, 3)) == 3);
     }
 
+#if TEST_STD_VER >= 23
----------------
H-G-Hristov wrote:

When I started https://github.com/llvm/llvm-project/pull/79744 there was a single header with forward declarations. In the middle of the development of https://github.com/llvm/llvm-project/pull/79744 the header with forward declarations was removed. In the paper https://wg21.link/P2819R2 there is an example that adding the tuple protocol to complex will enable ranges like elements_view to work with complex, so I added such test but with the aforementioned change (the removal of the global forward declarations header) the test failed to compile, so I had to do `#include <__fwd/complex.h>` I tried to create similar tests for the other types for completeness and to try to trigger the compilation failure. (I can't think of a better way to do it).
I created this https://github.com/llvm/llvm-project/pull/82236 to add the other forward declarations and this PR are the related tests, which turned out to not be necessary.
As https://github.com/llvm/llvm-project/pull/82236 turned out not to be necessary. Maybe the current PR is also no more needed. So if you think these tests are redundant, I'm fine to close this PR.

https://github.com/llvm/llvm-project/pull/82323


More information about the libcxx-commits mailing list