public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed 1/5] libstdc++: Fix -Wnarrowing warnings
@ 2020-09-10 18:17 Jonathan Wakely
  2020-09-10 18:18 ` [committed 2/5] libstdc++: Fix -Wdeprecated-declarations warnings Jonathan Wakely
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jonathan Wakely @ 2020-09-10 18:17 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

libstdc++-v3/ChangeLog:

	* include/bits/fs_path.h (path::_List::type()): Avoid narrowing
	conversion.
	* include/std/chrono (operator+(const year&, const years&)):
	Likewise.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1447 bytes --]

commit b6b9fd4af9ac46a8bb19a906e4c2afa14da91017
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 10 18:47:08 2020

    libstdc++: Fix -Wnarrowing warnings
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/fs_path.h (path::_List::type()): Avoid narrowing
            conversion.
            * include/std/chrono (operator+(const year&, const years&)):
            Likewise.

diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h
index 26ddf0afec4..5a0917c582d 100644
--- a/libstdc++-v3/include/bits/fs_path.h
+++ b/libstdc++-v3/include/bits/fs_path.h
@@ -667,7 +667,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;
 
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index afee7859c6d..9b9fd2bd42d 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -1591,7 +1591,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       friend constexpr year
       operator+(const year& __x, const years& __y) noexcept
-      { return year{int{__x} + __y.count()}; }
+      { return year{int{__x} + static_cast<int>(__y.count())}; }
 
       friend constexpr year
       operator+(const years& __x, const year& __y) noexcept

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-10 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 18:17 [committed 1/5] libstdc++: Fix -Wnarrowing warnings Jonathan Wakely
2020-09-10 18:18 ` [committed 2/5] libstdc++: Fix -Wdeprecated-declarations warnings Jonathan Wakely
2020-09-10 18:19 ` [committed 2/5] libstdc++: Fix macro redefinition warnings Jonathan Wakely
2020-09-10 18:20 ` [committed 4/5] libstdc++: Fix -Wunused-local-typedefs warning Jonathan Wakely
2020-09-10 18:20 ` [committed 5/5] libstdc++: Fix -Wsign-compare warnings 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).