public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5497] libstdc++: Fix -Wrange-loop-construct warnings in filesystem tests
@ 2020-11-27 13:34 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-11-27 13:34 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:4a7c7999086756b9d630ed6036eb7fdce69bb5cd

commit r11-5497-g4a7c7999086756b9d630ed6036eb7fdce69bb5cd
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 27 12:15:44 2020 +0000

    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.

Diff:
---
 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 96ccd777af4..712d131dfaa 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 dc7331945fe..4468a24efe7 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<path::value_type, char>)
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 0f912a5f74d..c0fd2aa3d9d 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 6f4166b641d..fd310fb827b 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 54b3510b9de..a61c7c4f609 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 032af98d9dd..94989706d1b 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 52dc3899cc7..2ab60144f73 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 cf3724025f7..f198a4c8197 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 3d14829e0d7..d514951649e 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 b89dd47bef9..6e24cc874c2 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 10ed3144fa2..aa0516f8aa3 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 43cb43b373d..b65f99758d3 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<path::iterator>;
   std::vector<path> 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 f47227a47e0..7848abd3f20 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 a7b61f0b9f2..6cb23008a43 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 48572ac8917..c8e39e25532 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 03da11f0360..b05f5f2d42c 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 d9adfad0a3e..ff3741c3382 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 34e8bf841c2..786634decb3 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 d665bcb74a2..0164fa1bd0c 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 707e7acb605..201406fc5af 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 b1848d7761d..f6287cbcf4d 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 7f34be268ca..3013dbf303a 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 ef606b3a764..3d44874a83f 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 5a35dedf165..741b409b1ee 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 0459873f76c..079f9c9314f 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 99c6951ebb6..19f1c8f0d29 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 c5318990f15..7893baf23bc 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 ba6fe3cbb0c..0ee4d944974 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 5c9627f63b6..8b9fb736657 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 2f793600324..09e2fd6e5e6 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 5228d0a8ca8..66606f7dca0 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 f075ba65e8a..50a00c55d5a 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 2d0b0882960..0c5b5f4fe78 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 066d7dcaba7..a6a7b8d2c79 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 3f12fad0bcd..bd3961a70ca 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 43b5091bb65..14221de3389 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 bbb500916e2..ffc48395747 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 dfd2cb0da24..7ffd526f02a 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 83ee78b10ae..c1481777ed6 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<path::iterator>;
   std::vector<path> 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 0537bf45461..5186c3d3105 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 5053c72724f..b0984544731 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 1d063b6e23f..858ecd98303 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 68534912ff0..931727fce9a 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 3041e106f4d..031bc828120 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 5fa4c6e4e58..5ad1e3d910f 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 5a16cf21b02..99d0b775f71 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 8674bda74b2..fa58a815092 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 262d7a4a2af..930c9cb31dc 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 05cc30679f0..951a746fc3b 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 bd771932f8a..501fc828582 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 acb70d955f1..103aff0e28f 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 6071400cb64..86a60c6b8c8 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() );
   }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-27 13:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 13:34 [gcc r11-5497] libstdc++: Fix -Wrange-loop-construct warnings in filesystem tests Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).