locale_facets.tcc (num_get<>::do_get(void*&)): If the failbit is set, don't set it...
authorPaolo Carlini <pcarlini@suse.de>
Thu, 18 Nov 2004 13:38:09 +0000 (13:38 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 18 Nov 2004 13:38:09 +0000 (13:38 +0000)
2004-11-18  Paolo Carlini  <pcarlini@suse.de>

* include/bits/locale_facets.tcc (num_get<>::do_get(void*&)):
If the failbit is set, don't set it again.
(money_get<>::_M_extract): Minor stylistic tweak: consistently
with the other functions, take care of eofbit at the end.

From-SVN: r90861

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc

index 370044a268a621473ff8edf07d04fa80c56c17ed..09e20fc9781571a2273fca712205e945e6fdc36c 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-18  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/locale_facets.tcc (num_get<>::do_get(void*&)):
+       If the failbit is set, don't set it again.
+       (money_get<>::_M_extract): Minor stylistic tweak: consistently
+       with the other functions, take care of eofbit at the end.
+
 2004-11-18  Paolo Carlini  <pcarlini@suse.de>
 
        DR 434. bitset::to_string() hard to use [Ready]
index 821697807e305d5b67ef9e83e095a64efb031238..b503c95430d8e2dcadd02d9a5e07e95ab13d5737 100644 (file)
@@ -825,8 +825,6 @@ namespace std
 
       if (!(__err & ios_base::failbit))
        __v = reinterpret_cast<void*>(__ul);
-      else
-       __err |= ios_base::failbit;
       return __beg;
     }
 
@@ -1481,16 +1479,15 @@ namespace std
              __testvalid = false;
          }
        
-       // Iff no more characters are available.
-       if (__beg == __end)
-         __err |= ios_base::eofbit;
-       
        // Iff valid sequence is not recognized.
        if (!__testvalid)
          __err |= ios_base::failbit;
        else
          __units.swap(__res);
        
+       // Iff no more characters are available.
+       if (__beg == __end)
+         __err |= ios_base::eofbit;
        return __beg;
       }