[libcxx-commits] [libcxx] 1d50cf9 - [libc++] IWYU in <filesystem> tests

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 23 03:08:44 PST 2021


Author: Nikolas Klauser
Date: 2021-12-23T12:03:36+01:00
New Revision: 1d50cf98b56fd17e675eb990572befbc440bceab

URL: https://github.com/llvm/llvm-project/commit/1d50cf98b56fd17e675eb990572befbc440bceab
DIFF: https://github.com/llvm/llvm-project/commit/1d50cf98b56fd17e675eb990572befbc440bceab.diff

LOG: [libc++] IWYU in <filesystem> tests

Add headers in `<filesystem>` tests that were transitively included
through `<filesystem>`

Reviewed as part of D116146

Added: 
    

Modified: 
    libcxx/src/filesystem/directory_iterator.cpp
    libcxx/src/filesystem/filesystem_common.h
    libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp
    libcxx/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp
    libcxx/test/support/filesystem_test_helper.h

Removed: 
    


################################################################################
diff  --git a/libcxx/src/filesystem/directory_iterator.cpp b/libcxx/src/filesystem/directory_iterator.cpp
index 6219ceafd36ea..90b255d9877f9 100644
--- a/libcxx/src/filesystem/directory_iterator.cpp
+++ b/libcxx/src/filesystem/directory_iterator.cpp
@@ -6,8 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "filesystem"
 #include "__config"
+#include "filesystem"
+#include "stack"
 #if defined(_LIBCPP_WIN32API)
 #define WIN32_LEAN_AND_MEAN
 #define NOMINMAX

diff  --git a/libcxx/src/filesystem/filesystem_common.h b/libcxx/src/filesystem/filesystem_common.h
index a2c340e61083c..717894e537d24 100644
--- a/libcxx/src/filesystem/filesystem_common.h
+++ b/libcxx/src/filesystem/filesystem_common.h
@@ -17,6 +17,7 @@
 #include "cstdlib"
 #include "ctime"
 #include "filesystem"
+#include "system_error"
 
 #if !defined(_LIBCPP_WIN32API)
 # include <unistd.h>

diff  --git a/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
index f93737c2372df..bbeaedd51f22e 100644
--- a/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
+++ b/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
@@ -14,12 +14,13 @@
 
 // ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../src/filesystem
 
-#include <filesystem>
+#include <cassert>
 #include <chrono>
-#include <type_traits>
-#include <limits>
 #include <cstddef>
-#include <cassert>
+#include <filesystem>
+#include <limits>
+#include <string>
+#include <type_traits>
 
 #include "filesystem_common.h"
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
index e71d4e24664a7..f7e5770a7cd73 100644
--- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp
@@ -19,10 +19,10 @@
 // bool operator> (directory_entry const&) const noexcept;
 // bool operator>=(directory_entry const&) const noexcept;
 
-
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <type_traits>
+#include <utility>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp
index 97b5d23d9dbb8..403d1ae338dd9 100644
--- a/libcxx/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp
@@ -19,8 +19,9 @@
 // typedef ... iterator_category
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <iterator>
+#include <type_traits>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp b/libcxx/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp
index 3c0ae5d0886cc..8fd23b60081bc 100644
--- a/libcxx/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp
@@ -21,8 +21,10 @@
 // const path& path2() const noexcept;
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <string>
+#include <system_error>
+#include <type_traits>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
index a7182557d3f7c..9044b2f5a45e4 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
@@ -15,8 +15,9 @@
 // path& operator=(path const&);
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <string>
+#include <type_traits>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
index 69dff085e58f8..0f3e4745fd530 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
@@ -17,8 +17,9 @@
 // path& operator=(path&&) noexcept
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <string>
+#include <type_traits>
 
 #include "test_macros.h"
 #include "count_new.h"

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
index 31d00ffd2cd3e..1155b7c1b3b5f 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
@@ -15,8 +15,9 @@
 // path(path const&)
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <string>
+#include <type_traits>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
index 40a8c54f802d6..9f575ba613298 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
@@ -16,8 +16,9 @@
 // path(path&&) noexcept
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <string>
+#include <type_traits>
 
 #include "test_macros.h"
 #include "count_new.h"

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp
index e9e0a990165a3..ab18399fd5d6c 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp
@@ -17,8 +17,9 @@
 // static constexpr value_type preferred_separator = ...;
 
 #include "filesystem_include.h"
-#include <type_traits>
 #include <cassert>
+#include <string>
+#include <type_traits>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h
index 00f4701e881af..44a01645dc49d 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -14,9 +14,10 @@
 #endif
 
 #include <cassert>
+#include <chrono>
 #include <cstdio> // for printf
 #include <string>
-#include <chrono>
+#include <system_error>
 #include <vector>
 
 #include "make_string.h"


        


More information about the libcxx-commits mailing list