From 4a7c7999086756b9d630ed6036eb7fdce69bb5cd Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 27 Nov 2020 12:15:44 +0000 Subject: [PATCH] libstdc++: Fix -Wrange-loop-construct warnings in filesystem tests Many tests do `for (const path& p : test_paths)` where test_paths is an array of strings. To avoid -Wrange-loop-construct warnings the loop variable should be an object, not a reference bound to a temporary. libstdc++-v3/ChangeLog: * testsuite/27_io/filesystem/operations/absolute.cc: Avoid -Wrange-loop-construct warning. * testsuite/27_io/filesystem/path/append/source.cc: Likewise. * testsuite/27_io/filesystem/path/assign/copy.cc: Likewise. * testsuite/27_io/filesystem/path/compare/path.cc: Likewise. * testsuite/27_io/filesystem/path/construct/copy.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/extension.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/filename.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/parent_path.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/relative_path.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/root_directory.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/root_path.cc: Likewise. * testsuite/27_io/filesystem/path/itr/traversal.cc: Likewise. * testsuite/27_io/filesystem/path/modifiers/remove_filename.cc: Likewise. * testsuite/27_io/filesystem/path/modifiers/replace_extension.cc: Likewise. * testsuite/27_io/filesystem/path/modifiers/replace_filename.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/append.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/cmp.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/hash_value.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_extension.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_filename.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_parent_path.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_relative_path.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_root_directory.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_root_name.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_root_path.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_stem.cc: Likewise. * testsuite/27_io/filesystem/path/query/is_relative.cc: Likewise. * testsuite/experimental/filesystem/operations/absolute.cc: Likewise. * testsuite/experimental/filesystem/path/assign/copy.cc: Likewise. * testsuite/experimental/filesystem/path/compare/path.cc: Likewise. * testsuite/experimental/filesystem/path/construct/copy.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/extension.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/filename.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/parent_path.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/relative_path.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/root_directory.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/root_path.cc: Likewise. * testsuite/experimental/filesystem/path/itr/traversal.cc: Likewise. * testsuite/experimental/filesystem/path/modifiers/remove_filename.cc: Likewise. * testsuite/experimental/filesystem/path/modifiers/replace_extension.cc: Likewise. * testsuite/experimental/filesystem/path/modifiers/replace_filename.cc: Likewise. * testsuite/experimental/filesystem/path/nonmember/hash_value.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_extension.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_filename.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_parent_path.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_relative_path.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_root_directory.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_root_name.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_root_path.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_stem.cc: Likewise. * testsuite/experimental/filesystem/path/query/is_relative.cc: Likewise. --- libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc | 4 ++-- libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc | 4 ++-- libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc | 4 ++-- libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc | 2 +- .../testsuite/27_io/filesystem/path/decompose/relative_path.cc | 2 +- .../testsuite/27_io/filesystem/path/decompose/root_directory.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc | 2 +- .../testsuite/27_io/filesystem/path/modifiers/remove_filename.cc | 2 +- .../testsuite/27_io/filesystem/path/modifiers/replace_extension.cc | 2 +- .../testsuite/27_io/filesystem/path/modifiers/replace_filename.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc | 4 ++-- libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc | 2 +- .../testsuite/27_io/filesystem/path/query/has_relative_path.cc | 2 +- .../testsuite/27_io/filesystem/path/query/has_root_directory.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc | 2 +- libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc | 2 +- libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc | 2 +- libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc | 4 ++-- libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc | 2 +- libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc | 4 ++-- .../testsuite/experimental/filesystem/path/decompose/extension.cc | 2 +- .../testsuite/experimental/filesystem/path/decompose/filename.cc | 2 +- .../testsuite/experimental/filesystem/path/decompose/parent_path.cc | 2 +- .../testsuite/experimental/filesystem/path/decompose/relative_path.cc | 2 +- .../experimental/filesystem/path/decompose/root_directory.cc | 2 +- .../testsuite/experimental/filesystem/path/decompose/root_path.cc | 2 +- libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc | 2 +- .../experimental/filesystem/path/modifiers/remove_filename.cc | 2 +- .../experimental/filesystem/path/modifiers/replace_extension.cc | 2 +- .../experimental/filesystem/path/modifiers/replace_filename.cc | 2 +- .../testsuite/experimental/filesystem/path/nonmember/hash_value.cc | 2 +- .../testsuite/experimental/filesystem/path/query/has_extension.cc | 2 +- .../testsuite/experimental/filesystem/path/query/has_filename.cc | 2 +- .../testsuite/experimental/filesystem/path/query/has_parent_path.cc | 2 +- .../testsuite/experimental/filesystem/path/query/has_relative_path.cc | 2 +- .../experimental/filesystem/path/query/has_root_directory.cc | 2 +- .../testsuite/experimental/filesystem/path/query/has_root_name.cc | 2 +- .../testsuite/experimental/filesystem/path/query/has_root_path.cc | 2 +- libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc | 2 +- .../testsuite/experimental/filesystem/path/query/is_relative.cc | 2 +- 52 files changed, 58 insertions(+), 58 deletions(-) diff --git a/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc b/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc index 96ccd77..712d131 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc @@ -30,7 +30,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { std::error_code ec; path abs = absolute(p, ec); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc index dc73319..4468a24 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc @@ -92,8 +92,8 @@ test02() void test03() { - for (const path& p : __gnu_test::test_paths) - for (const path& q : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) + for (const path q : __gnu_test::test_paths) { test(p, q.c_str()); if constexpr (!std::is_same_v) diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc index 0f912a5..c0fd2aa 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc @@ -28,7 +28,7 @@ using __gnu_test::compare_paths; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy; copy = p; @@ -39,7 +39,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy = p; path move; diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc index 6f4166b..fd310fb 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc @@ -30,7 +30,7 @@ void test01() { const path p0 = "/a/a/b/b"; - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.compare(p) == 0 ); int cmp = p.compare(p0); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc index 54b3510..a61c7c4 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc @@ -28,7 +28,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy = p; __gnu_test::compare_paths(p, copy); @@ -38,7 +38,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy = p; path move = std::move(copy); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc index 032af98..9498970 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc @@ -51,7 +51,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { auto stem = p.stem(); auto ext = p.extension(); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc index 52dc3899..2ab6014 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc @@ -46,7 +46,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path f = p.filename(); if (p.empty()) diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc index cf37240..f198a4c 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc @@ -46,7 +46,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { if (p.begin() == p.end()) continue; diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/relative_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/relative_path.cc index 3d14829..d514951 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/relative_path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/relative_path.cc @@ -42,7 +42,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { bool after_root = false; const path prel = p.relative_path(); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_directory.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_directory.cc index b89dd47..6e24cc8 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_directory.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_directory.cc @@ -46,7 +46,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path rootdir = p.root_directory(); VERIFY( !rootdir.has_relative_path() ); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc index 10ed314..aa0516f 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc @@ -38,7 +38,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path rootp = p.root_path(); path rootn = p.root_name(); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc index 43cb43b..b65f997 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc @@ -108,7 +108,7 @@ test02() using reverse_iterator = std::reverse_iterator; std::vector fwd, rev; - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { const auto begin = p.begin(), end = p.end(); fwd.assign(begin, end); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/remove_filename.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/remove_filename.cc index f47227a..7848abd 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/remove_filename.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/remove_filename.cc @@ -40,7 +40,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path p2(p); p2.remove_filename(); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_extension.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_extension.cc index a7b61f0..6cb2300 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_extension.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_extension.cc @@ -47,7 +47,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path p2 = p; compare_paths( p2.replace_extension(p2.extension()), p ); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_filename.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_filename.cc index 48572ac..c8e39e2 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_filename.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_filename.cc @@ -38,7 +38,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path p2(p); p2.replace_filename(p.filename()); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc index 03da11f..b05f5f2 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc @@ -69,8 +69,8 @@ test02() void test03() { - for (const path& p : __gnu_test::test_paths) - for (const path& q : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) + for (const path q : __gnu_test::test_paths) test(p, q); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp.cc index d9adfad..ff3741c 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp.cc @@ -47,7 +47,7 @@ void test02() { const path p0 = "/a/a/b/b"; - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.compare(p) == 0 ); int cmp = p.compare(p0); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc index 34e8bf8..786634d 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc @@ -53,7 +53,7 @@ void test02() { const path p0 = "/a/a/b/b"; - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( std::is_eq(p <=> p) ); VERIFY( (p <=> p0) == (p.compare(p0) <=> 0) ); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc index d665bcb..0164fa1 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc @@ -36,7 +36,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path pp = p.native(); VERIFY( hash_value(p) == hash_value(pp) ); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc index 707e7ac..201406f 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_extension() == !p.extension().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc index b1848d7..f6287cb 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_filename() == !p.filename().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc index 7f34be2..3013dbf 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_parent_path() == !p.parent_path().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_relative_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_relative_path.cc index ef606b3..3d44874 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_relative_path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_relative_path.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_relative_path() == !p.relative_path().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_directory.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_directory.cc index 5a35ded..741b409 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_directory.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_directory.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_root_directory() == !p.root_directory().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc index 0459873..079f9c9 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_root_name() == !p.root_name().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc index 99c6951..19f1c8f 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_root_path() == !p.root_path().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc index c531899..7893baf 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_stem() == !p.stem().empty() ); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc index ba6fe3c..0ee4d94 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc @@ -29,7 +29,7 @@ using std::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.is_relative() == !p.is_absolute() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc index 5c9627f..8b9fb73 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { #if defined(__MINGW32__) || defined(__MINGW64__) if (p.empty()) diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc index 2f79360..09e2fd6 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc @@ -28,7 +28,7 @@ using __gnu_test::compare_paths; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy; copy = p; @@ -39,7 +39,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy = p; path move; diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc index 5228d0a..66606f7 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc @@ -31,7 +31,7 @@ void test01() { const path p0 = "/a/a/b/b"; - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.compare(p) == 0 ); int cmp = p.compare(p0); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc index f075ba6..50a00c5 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc @@ -29,7 +29,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy = p; __gnu_test::compare_paths(p, copy); @@ -39,7 +39,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path copy = p; path move = std::move(copy); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc index 2d0b088..0c5b5f4 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc @@ -44,7 +44,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { auto stem = p.stem(); auto ext = p.extension(); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc index 066d7dc..a6a7b8d 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc @@ -39,7 +39,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path f = p.filename(); if (p.empty()) diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc index 3f12fad..bd3961a 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc @@ -43,7 +43,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { if (p.begin() == p.end()) continue; diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc index 43b5091..14221de 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc @@ -41,7 +41,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { bool after_root = false; const path prel = p.relative_path(); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc index bbb5009..ffc4839 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc @@ -43,7 +43,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path rootdir = p.root_directory(); // If root-directory is composed of 'slash name', diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc index dfd2cb0..7ffd526 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc @@ -39,7 +39,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path rootp = p.root_path(); path rootn = p.root_name(); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc index 83ee78b..c148177 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc @@ -69,7 +69,7 @@ test02() using reverse_iterator = std::reverse_iterator; std::vector fwd, rev; - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { const auto begin = p.begin(), end = p.end(); fwd.assign(begin, end); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc index 0537bf4..5186c3d 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc @@ -37,7 +37,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path p2(p); p2.remove_filename(); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc index 5053c72..b098454 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc @@ -38,7 +38,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path p2 = p; VERIFY(p2.replace_extension(p2.extension()) == p); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc index 1d063b6..858ecd9 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc @@ -37,7 +37,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path p2(p); p2.replace_filename(p.filename()); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc index 6853491..931727f 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc @@ -37,7 +37,7 @@ test01() void test02() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { path pp = p.native(); VERIFY( hash_value(p) == hash_value(pp) ); diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc index 3041e10..031bc82 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_extension() == !p.extension().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc index 5fa4c6e..5ad1e3d 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_filename() == !p.filename().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc index 5a16cf2..99d0b77 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_parent_path() == !p.parent_path().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc index 8674bda..fa58a81 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_relative_path() == !p.relative_path().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc index 262d7a4..930c9cb 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_root_directory() == !p.root_directory().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc index 05cc306..951a746 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_root_name() == !p.root_name().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc index bd77193..501fc82 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_root_path() == !p.root_path().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc index acb70d9..103aff0 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.has_stem() == !p.stem().empty() ); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc index 6071400..86a60c6 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc @@ -30,7 +30,7 @@ using std::experimental::filesystem::path; void test01() { - for (const path& p : __gnu_test::test_paths) + for (const path p : __gnu_test::test_paths) { VERIFY( p.is_relative() == !p.is_absolute() ); } -- 2.7.4