[libcxx-commits] [libcxx] [libc++] Implement LWG3430 std::fstream & co. should be constructible from string_view (PR #85079)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 14 06:22:08 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 15e9478187d594016c2c355d8688be2e0a9b554e 5e995e9bd13a9cace6df3c519c0041c584763af4 -- libcxx/include/fstream libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
index bc2d85ec1b..a787b921a4 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
@@ -31,17 +31,16 @@ namespace fs = std::filesystem;
 
 template <class CharT>
 constexpr bool test_non_convert_to_path() {
-
   // String types
   static_assert(!std::is_constructible_v<std::fstream, std::basic_string_view<CharT>>);
   static_assert(!std::is_constructible_v<std::fstream, const std::basic_string_view<CharT>>);
 
   // Char* pointers
   if constexpr (!std::is_same_v<CharT, char>)
-    static_assert(!std::is_constructible_v<std::fstream, const CharT *>);
+    static_assert(!std::is_constructible_v<std::fstream, const CharT*>);
 
   // Iterators
-  static_assert(!std::is_convertible_v<std::fstream, cpp17_input_iterator<const CharT *>>);
+  static_assert(!std::is_convertible_v<std::fstream, cpp17_input_iterator<const CharT*>>);
 
   return true;
 }
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
index 41a0e4a1ad..8d81ec3191 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
@@ -32,17 +32,16 @@ namespace fs = std::filesystem;
 
 template <class CharT>
 constexpr bool test_non_convert_to_path() {
-
   // String types
   static_assert(!std::is_constructible_v<std::ifstream, std::basic_string_view<CharT>>);
   static_assert(!std::is_constructible_v<std::ifstream, const std::basic_string_view<CharT>>);
 
   // Char* pointers
   if constexpr (!std::is_same_v<CharT, char>)
-    static_assert(!std::is_constructible_v<std::ifstream, const CharT *>);
+    static_assert(!std::is_constructible_v<std::ifstream, const CharT*>);
 
   // Iterators
-  static_assert(!std::is_convertible_v<std::ifstream, cpp17_input_iterator<const CharT *>>);
+  static_assert(!std::is_convertible_v<std::ifstream, cpp17_input_iterator<const CharT*>>);
 
   return true;
 }
@@ -60,7 +59,6 @@ static_assert(test_non_convert_to_path<char8_t>());
 static_assert(test_non_convert_to_path<char16_t>());
 static_assert(test_non_convert_to_path<char32_t>());
 
-
 int main(int, char**) {
   {
     fs::path p;
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
index a07e10721b..d7da92f9a4 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
@@ -30,17 +30,16 @@ namespace fs = std::filesystem;
 
 template <class CharT>
 constexpr bool test_non_convert_to_path() {
-
   // String types
   static_assert(!std::is_constructible_v<std::ofstream, std::basic_string_view<CharT>>);
   static_assert(!std::is_constructible_v<std::ofstream, const std::basic_string_view<CharT>>);
 
   // Char* pointers
   if constexpr (!std::is_same_v<CharT, char>)
-    static_assert(!std::is_constructible_v<std::ofstream, const CharT *>);
+    static_assert(!std::is_constructible_v<std::ofstream, const CharT*>);
 
   // Iterators
-  static_assert(!std::is_convertible_v<std::ofstream, cpp17_input_iterator<const CharT *>>);
+  static_assert(!std::is_convertible_v<std::ofstream, cpp17_input_iterator<const CharT*>>);
 
   return true;
 }

``````````

</details>


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


More information about the libcxx-commits mailing list