Missing traits::to_int_type in fstream

llvm-svn: 124727
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: da3b02fdb3cfa7ba6e7edbdf00ac9db6d6b55bbe
diff --git a/include/fstream b/include/fstream
index 5734aa0..809a497 100644
--- a/include/fstream
+++ b/include/fstream
@@ -579,7 +579,7 @@
                 this->setg(this->eback(),
                            this->eback() + __unget_sz,
                            this->eback() + __unget_sz + __nmemb);
-                __c = *this->gptr();
+                __c = traits_type::to_int_type(*this->gptr());
             }
         }
         else
@@ -602,18 +602,18 @@
                 if (__r == codecvt_base::noconv)
                 {
                     this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_);
-                    __c = *this->gptr();
+                    __c = traits_type::to_int_type(*this->gptr());
                 }
                 else if (__inext != this->eback() + __unget_sz)
                 {
                     this->setg(this->eback(), this->eback() + __unget_sz, __inext);
-                    __c = *this->gptr();
+                    __c = traits_type::to_int_type(*this->gptr());
                 }
             }
         }
     }
     else
-        __c = *this->gptr();
+        __c = traits_type::to_int_type(*this->gptr());
     if (this->eback() == &__1buf)
         this->setg(0, 0, 0);
     return __c;