[libcxx-commits] [libcxx] [libc++][test] enable_borrowed_range compile -> verify for ranges::as_rvalue_view (PR #75066)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 11 08:35:59 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Will Hawkins (hawkinsw)
<details>
<summary>Changes</summary>
Rename (and fixup) file containing the enable_borrowed_range tests for ranges::as_rvalue_view by converting to verify test.
---
Full diff: https://github.com/llvm/llvm-project/pull/75066.diff
2 Files Affected:
- (removed) libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.compile.pass.cpp (-16)
- (added) libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.verify.cpp (+19)
``````````diff
diff --git a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.compile.pass.cpp
deleted file mode 100644
index 48d1d96b02482..0000000000000
--- a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.compile.pass.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-
-#include <ranges>
-#include <vector>
-
-static_assert(std::ranges::enable_borrowed_range<std::ranges::as_rvalue_view<std::ranges::empty_view<int>>>);
-static_assert(std::ranges::enable_borrowed_range<std::ranges::as_rvalue_view<std::views::all_t<std::vector<int>&>>>);
-static_assert(!std::ranges::enable_borrowed_range<std::ranges::as_rvalue_view<std::views::all_t<std::vector<int>>>>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.verify.cpp b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.verify.cpp
new file mode 100644
index 0000000000000..184d2dac57e15
--- /dev/null
+++ b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/enable_borrowed_range.verify.cpp
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+#include <ranges>
+#include <vector>
+
+static_assert(std::ranges::enable_borrowed_range<
+ std::ranges::as_rvalue_view<std::ranges::empty_view<int>>>); // expected-no-diagnostics
+static_assert(std::ranges::enable_borrowed_range<
+ std::ranges::as_rvalue_view<std::views::all_t<std::vector<int>&>>>); // expected-no-diagnostics
+static_assert(!std::ranges::enable_borrowed_range<
+ std::ranges::as_rvalue_view<std::views::all_t<std::vector<int>>>>); // expected-no-diagnostics
``````````
</details>
https://github.com/llvm/llvm-project/pull/75066
More information about the libcxx-commits
mailing list