diff --git a/stl/inc/ios b/stl/inc/ios index 881c292ba29..24353546712 100644 --- a/stl/inc/ios +++ b/stl/inc/ios @@ -206,8 +206,8 @@ _EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL hex(ios_base& _Iosbase) { // set return _Iosbase; } -_EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL hexfloat(ios_base& _Iosbase) { // set floatfield to hexfloat - _Iosbase.setf(ios_base::hexfloat, ios_base::floatfield); +_EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL hexfloat(ios_base& _Iosbase) { // set floatfield to (scientific | fixed) + _Iosbase.setf(ios_base::scientific | ios_base::fixed, ios_base::floatfield); return _Iosbase; } diff --git a/stl/inc/xiosbase b/stl/inc/xiosbase index a1b5ff24ae3..af192b61692 100644 --- a/stl/inc/xiosbase +++ b/stl/inc/xiosbase @@ -42,8 +42,6 @@ public: static constexpr int scientific = 0x1000; static constexpr int fixed = 0x2000; - static constexpr int hexfloat = 0x3000; // TRANSITION, ABI, GH-3296 - static constexpr int boolalpha = 0x4000; static constexpr int adjustfield = left | right | internal; static constexpr int basefield = dec | oct | hex; diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index cb0ddec7575..619596ea9d1 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -1441,7 +1441,7 @@ private: if (_Flags & ios_base::uppercase) { if (_Ffl == ios_base::fixed) { _Ch = 'f'; - } else if (_Ffl == ios_base::hexfloat) { + } else if (_Ffl == (ios_base::scientific | ios_base::fixed)) { _Ch = 'A'; // added with TR1 } else if (_Ffl == ios_base::scientific) { _Ch = 'E'; @@ -1451,7 +1451,7 @@ private: } else { if (_Ffl == ios_base::fixed) { _Ch = 'f'; - } else if (_Ffl == ios_base::hexfloat) { + } else if (_Ffl == (ios_base::scientific | ios_base::fixed)) { _Ch = 'a'; // added with TR1 } else if (_Ffl == ios_base::scientific) { _Ch = 'e'; @@ -1475,7 +1475,7 @@ private: bool _Is_finite_val) const { // put formatted floating-point to _Dest auto _Prefix = static_cast(0 < _Count && (*_Buf == '+' || *_Buf == '-')); const char* _Exps; - if ((_Iosbase.flags() & ios_base::floatfield) != ios_base::hexfloat) { + if ((_Iosbase.flags() & ios_base::floatfield) != (ios_base::scientific | ios_base::fixed)) { _Exps = "eE"; } else { // correct for hexadecimal floating-point _Exps = "pP"; diff --git a/tests/tr1/tests/ios/test.cpp b/tests/tr1/tests/ios/test.cpp index 43cb33b11be..f425e7e7ba1 100644 --- a/tests/tr1/tests/ios/test.cpp +++ b/tests/tr1/tests/ios/test.cpp @@ -12,11 +12,11 @@ #include // static data -static const STD ios_base::fmtflags ffl[] = {STD ios_base::hexfloat, STD ios_base::dec, STD ios_base::fixed, - STD ios_base::hex, STD ios_base::internal, STD ios_base::left, STD ios_base::oct, STD ios_base::right, - STD ios_base::scientific, STD ios_base::showbase, STD ios_base::showpoint, STD ios_base::showpos, - STD ios_base::skipws, STD ios_base::unitbuf, STD ios_base::uppercase, STD ios_base::boolalpha, - STD ios_base::adjustfield, STD ios_base::basefield, STD ios_base::floatfield}; +static const STD ios_base::fmtflags ffl[] = {STD ios_base::dec, STD ios_base::fixed, STD ios_base::hex, + STD ios_base::internal, STD ios_base::left, STD ios_base::oct, STD ios_base::right, STD ios_base::scientific, + STD ios_base::showbase, STD ios_base::showpoint, STD ios_base::showpos, STD ios_base::skipws, STD ios_base::unitbuf, + STD ios_base::uppercase, STD ios_base::boolalpha, STD ios_base::adjustfield, STD ios_base::basefield, + STD ios_base::floatfield}; static const STD ios_base::iostate ifl[] = { STD ios_base::badbit, STD ios_base::eofbit, STD ios_base::failbit, STD ios_base::goodbit}; @@ -86,8 +86,6 @@ void test_main() { // test basic workings of ios definitions CHECK_INT(STD ios_base::dec | STD ios_base::oct | STD ios_base::hex, STD ios_base::basefield); CHECK_INT(STD ios_base::scientific | STD ios_base::fixed, STD ios_base::floatfield); - CHECK_INT(STD ios_base::scientific | STD ios_base::fixed, STD ios_base::hexfloat); - // test assignment and control functions CHECK(x && true); CHECK(!x == 0); @@ -170,7 +168,7 @@ void test_main() { // test basic workings of ios definitions CHECK_INT(x.flags(), STD ios_base::scientific | STD ios_base::unitbuf); x.clear(STD ios_base::floatfield); - x.setf(STD ios_base::hexfloat); + x.setf(STD ios_base::scientific | STD ios_base::fixed); CHECK_INT(x.flags(), STD ios_base::scientific | STD ios_base::fixed | STD ios_base::unitbuf); CHECK_INT(x.precision(INT_MIN), 6); @@ -216,13 +214,13 @@ void test_main() { // test basic workings of ios definitions CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::scientific); STD hexfloat(*po); - CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::hexfloat); + CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::scientific | STD ios_base::fixed); STD defaultfloat(*po); CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right); STD hexfloat(*po); - CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::hexfloat); + CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::scientific | STD ios_base::fixed); STD error_code ec1 = STD make_error_code(STD io_errc::stream); CHECK(ec1.value() == (int) STD io_errc::stream);