[gcc r10-9562] libstdc++: Fix -Wnarrowing warnings

Jonathan Wakely redi@gcc.gnu.org
Mon Mar 29 20:00:41 GMT 2021


https://gcc.gnu.org/g:2c64e054f7ebc3b56deafbc36141f5863004f5d3

commit r10-9562-g2c64e054f7ebc3b56deafbc36141f5863004f5d3
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 10 18:47:08 2020 +0100

    libstdc++: Fix -Wnarrowing warnings
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/fs_path.h (path::_List::type()): Avoid narrowing
            conversion.
    
    (cherry picked from commit b6b9fd4af9ac46a8bb19a906e4c2afa14da91017)

Diff:
---
 libstdc++-v3/include/bits/fs_path.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h
index 409e8b84e31..0b9911e638a 100644
--- a/libstdc++-v3/include/bits/fs_path.h
+++ b/libstdc++-v3/include/bits/fs_path.h
@@ -614,7 +614,7 @@ namespace __detail
       ~_List() = default;
 
       _Type type() const noexcept
-      { return _Type{reinterpret_cast<uintptr_t>(_M_impl.get()) & 0x3}; }
+      { return _Type(reinterpret_cast<uintptr_t>(_M_impl.get()) & 0x3); }
 
       void type(_Type) noexcept;


More information about the Gcc-cvs mailing list