Index: libcxx/include/locale =================================================================== --- libcxx/include/locale +++ libcxx/include/locale @@ -2885,6 +2885,11 @@ unique_ptr& __wb, char_type*& __wn, char_type* __we) { + if (__b == __e) + { + __err |= ios_base::failbit; + return false; + } const unsigned __bz = 100; unsigned __gbuf[__bz]; unique_ptr __gb(__gbuf, __do_nothing); Index: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp =================================================================== --- libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp +++ libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp @@ -721,6 +721,17 @@ assert(err == std::ios_base::failbit); } } + { + // test for err + const my_facet f(1); + std::string v = "1.23"; + typedef input_iterator I; + long double ex = -1L; + std::ios_base::iostate err = std::ios_base::goodbit; + f.get(I(v.data()), I(v.data()), false, ios, err, ex); + assert(err == (std::ios_base::failbit | std::ios_base::eofbit)); + assert(ex == -1L); + } return 0; } Index: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp =================================================================== --- libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp +++ libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp @@ -729,6 +729,17 @@ assert(ex == L""); } } + { + // test for err + const my_facet f(1); + std::string v = "1.23"; + typedef input_iterator I; + std::string ex = "NULL"; + std::ios_base::iostate err = std::ios_base::goodbit; + f.get(I(v.data()), I(v.data()), false, ios, err, ex); + assert(err == (std::ios_base::failbit | std::ios_base::eofbit)); + assert(ex == "NULL"); + } return 0; }