PR libstdc++/79980 fix target type of cast
authorJonathan Wakely <jwakely@redhat.com>
Thu, 16 Mar 2017 17:22:47 +0000 (17:22 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 16 Mar 2017 17:22:47 +0000 (17:22 +0000)
PR libstdc++/79980
* src/c++11/codecvt.cc (to_integer(codecvt_mode)): Fix target type.

From-SVN: r246205

libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/codecvt.cc

index cf94ab5..d035d91 100644 (file)
@@ -1,5 +1,8 @@
 2017-03-16  Jonathan Wakely  <jwakely@redhat.com>
 
+       PR libstdc++/79980
+       * src/c++11/codecvt.cc (to_integer(codecvt_mode)): Fix target type.
+
        PR libstdc++/80041
        * src/c++11/codecvt.cc (__codecvt_utf16_base<wchar_t>::do_out)
        (__codecvt_utf16_base<wchar_t>::do_in): Convert char arguments to
index ef38267..02866ef 100644 (file)
@@ -34,7 +34,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // The standard doesn't define these operators, which is annoying.
   static underlying_type<codecvt_mode>::type
   to_integer(codecvt_mode m)
-  { return static_cast<mode_t>(m); }
+  { return static_cast<underlying_type<codecvt_mode>::type>(m); }
 
   static codecvt_mode& operator&=(codecvt_mode& m, codecvt_mode n)
   { return m = codecvt_mode(to_integer(m) & to_integer(n)); }