libstdc++: Fix -Wrange-loop-construct warnings in filesystem tests
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Nov 2020 12:15:44 +0000 (12:15 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 27 Nov 2020 13:34:22 +0000 (13:34 +0000)
commit4a7c7999086756b9d630ed6036eb7fdce69bb5cd
treef6e0d65f77b1f5d5f81ebcf9964660968ba7bee3
parentb8ae0812ee567fa380f0a8c7f30c7a660a5069c3
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.
52 files changed:
libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc
libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc
libstdc++-v3/testsuite/27_io/filesystem/path/assign/copy.cc
libstdc++-v3/testsuite/27_io/filesystem/path/compare/path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/construct/copy.cc
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/extension.cc
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/filename.cc
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/parent_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/relative_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_directory.cc
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/itr/traversal.cc
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/remove_filename.cc
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_extension.cc
libstdc++-v3/testsuite/27_io/filesystem/path/modifiers/replace_filename.cc
libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/append.cc
libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp.cc
libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc
libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_extension.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_filename.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_parent_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_relative_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_directory.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_name.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_root_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/has_stem.cc
libstdc++-v3/testsuite/27_io/filesystem/path/query/is_relative.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc
libstdc++-v3/testsuite/experimental/filesystem/path/assign/copy.cc
libstdc++-v3/testsuite/experimental/filesystem/path/compare/path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/construct/copy.cc
libstdc++-v3/testsuite/experimental/filesystem/path/decompose/extension.cc
libstdc++-v3/testsuite/experimental/filesystem/path/decompose/filename.cc
libstdc++-v3/testsuite/experimental/filesystem/path/decompose/parent_path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/decompose/relative_path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc
libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/itr/traversal.cc
libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/remove_filename.cc
libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_extension.cc
libstdc++-v3/testsuite/experimental/filesystem/path/modifiers/replace_filename.cc
libstdc++-v3/testsuite/experimental/filesystem/path/nonmember/hash_value.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_extension.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_filename.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_parent_path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_relative_path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_directory.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_name.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_root_path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/has_stem.cc
libstdc++-v3/testsuite/experimental/filesystem/path/query/is_relative.cc