https://gcc.gnu.org/g:5bc51d02fdc86e482e627830d0abba1d38c23c34

commit r17-6513-g5bc51d02fdc86e482e627830d0abba1d38c23c34
Author: Thomas Schwinge <[email protected]>
Date:   Sun Nov 8 16:59:32 2026 +0100

    Avoid '-Wunused-parameter' diagnostics in 
'libstdc++-v3/src/filesystem/ops.cc'
    
    For '--target=x86_64-w64-mingw32', with '--enable-werror':
    
        ../../../../../source-gcc/libstdc++-v3/src/filesystem/ops.cc: In 
function ‘void 
std::experimental::filesystem::v1::create_directory_symlink(const 
__cxx11::path&, const __cxx11::path&, std::error_code&)’:
        ../../../../../source-gcc/libstdc++-v3/src/filesystem/ops.cc:584:42: 
error: unused parameter ‘to’ [-Werror=unused-parameter]
          584 | fs::create_directory_symlink(const path& to, const path& 
new_symlink,
              |                              ~~~~~~~~~~~~^~
        ../../../../../source-gcc/libstdc++-v3/src/filesystem/ops.cc:584:58: 
error: unused parameter ‘new_symlink’ [-Werror=unused-parameter]
          584 | fs::create_directory_symlink(const path& to, const path& 
new_symlink,
              |                                              
~~~~~~~~~~~~^~~~~~~~~~~
        ../../../../../source-gcc/libstdc++-v3/src/filesystem/ops.cc: In 
function ‘void std::experimental::filesystem::v1::create_symlink(const 
__cxx11::path&, const __cxx11::path&, std::error_code&)’:
        ../../../../../source-gcc/libstdc++-v3/src/filesystem/ops.cc:635:32: 
error: unused parameter ‘to’ [-Werror=unused-parameter]
          635 | fs::create_symlink(const path& to, const path& new_symlink,
              |                    ~~~~~~~~~~~~^~
        ../../../../../source-gcc/libstdc++-v3/src/filesystem/ops.cc:635:48: 
error: unused parameter ‘new_symlink’ [-Werror=unused-parameter]
          635 | fs::create_symlink(const path& to, const path& new_symlink,
              |                                    ~~~~~~~~~~~~^~~~~~~~~~~
    
            libstdc++-v3/
            * src/filesystem/ops.cc (fs::create_directory_symlink): Tag 'to',
            'path' as '[[maybe_unused]]'.
            (fs::create_symlink): Tag 'to', 'new_symlink' as
            '[[maybe_unused]]'.

Diff:
---
 libstdc++-v3/src/filesystem/ops.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/src/filesystem/ops.cc 
b/libstdc++-v3/src/filesystem/ops.cc
index 80f83c049c7d..9a627cfc87b4 100644
--- a/libstdc++-v3/src/filesystem/ops.cc
+++ b/libstdc++-v3/src/filesystem/ops.cc
@@ -581,7 +581,8 @@ fs::create_directory_symlink(const path& to, const path& 
new_symlink)
 }
 
 void
-fs::create_directory_symlink(const path& to, const path& new_symlink,
+fs::create_directory_symlink([[maybe_unused]] const path& to,
+                            [[maybe_unused]] const path& new_symlink,
                             error_code& ec) noexcept
 {
 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
@@ -632,7 +633,8 @@ fs::create_symlink(const path& to, const path& new_symlink)
 }
 
 void
-fs::create_symlink(const path& to, const path& new_symlink,
+fs::create_symlink([[maybe_unused]] const path& to,
+                  [[maybe_unused]] const path& new_symlink,
                   error_code& ec) noexcept
 {
 #ifdef _GLIBCXX_HAVE_SYMLINK

Reply via email to