@@ -67,11 +67,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_c_locale_timepunct = _S_get_c_locale();
_M_data->_M_date_format = "%m/%d/%y";
- _M_data->_M_date_era_format = "%m/%d/%y";
+ _M_data->_M_date_era_format = _M_data->_M_date_format;
_M_data->_M_time_format = "%H:%M:%S";
- _M_data->_M_time_era_format = "%H:%M:%S";
- _M_data->_M_date_time_format = "";
- _M_data->_M_date_time_era_format = "";
+ _M_data->_M_time_era_format = _M_data->_M_time_format;
+ _M_data->_M_date_time_format = "%a %b %e %T %Y";
+ _M_data->_M_date_time_era_format = _M_data->_M_date_time_format;
_M_data->_M_am = "AM";
_M_data->_M_pm = "PM";
_M_data->_M_am_pm_format = "%I:%M:%S %p";
@@ -224,11 +224,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_c_locale_timepunct = _S_get_c_locale();
_M_data->_M_date_format = L"%m/%d/%y";
- _M_data->_M_date_era_format = L"%m/%d/%y";
+ _M_data->_M_date_era_format = _M_data->_M_date_format;
_M_data->_M_time_format = L"%H:%M:%S";
- _M_data->_M_time_era_format = L"%H:%M:%S";
- _M_data->_M_date_time_format = L"";
- _M_data->_M_date_time_era_format = L"";
+ _M_data->_M_time_era_format = _M_data->_M_time_format;
+ _M_data->_M_date_time_format = L"%a %b %e %T %Y";
+ _M_data->_M_date_time_era_format = _M_data->_M_date_time_format;
_M_data->_M_am = L"AM";
_M_data->_M_pm = L"PM";
_M_data->_M_am_pm_format = L"%I:%M:%S %p";
@@ -65,11 +65,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_data = new __timepunct_cache<char>;
_M_data->_M_date_format = "%m/%d/%y";
- _M_data->_M_date_era_format = "%m/%d/%y";
+ _M_data->_M_date_era_format = _M_data->_M_date_format;
_M_data->_M_time_format = "%H:%M:%S";
- _M_data->_M_time_era_format = "%H:%M:%S";
- _M_data->_M_date_time_format = "";
- _M_data->_M_date_time_era_format = "";
+ _M_data->_M_time_era_format = _M_data->_M_time_format;
+ _M_data->_M_date_time_format = "%a %b %e %T %Y";
+ _M_data->_M_date_time_era_format = _M_data->_M_date_time_format;
_M_data->_M_am = "AM";
_M_data->_M_pm = "PM";
_M_data->_M_am_pm_format = "%I:%M:%S %p";
@@ -73,11 +73,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_c_locale_timepunct = _S_get_c_locale();
_M_data->_M_date_format = "%m/%d/%y";
- _M_data->_M_date_era_format = "%m/%d/%y";
+ _M_data->_M_date_era_format = _M_data->_M_date_format;
_M_data->_M_time_format = "%H:%M:%S";
- _M_data->_M_time_era_format = "%H:%M:%S";
- _M_data->_M_date_time_format = "";
- _M_data->_M_date_time_era_format = "";
+ _M_data->_M_time_era_format = _M_data->_M_time_format;
+ _M_data->_M_date_time_format = "%a %b %e %T %Y";
+ _M_data->_M_date_time_era_format = _M_data->_M_date_time_format;
_M_data->_M_am = "AM";
_M_data->_M_pm = "PM";
_M_data->_M_am_pm_format = "%I:%M:%S %p";
@@ -229,11 +229,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_c_locale_timepunct = _S_get_c_locale();
_M_data->_M_date_format = L"%m/%d/%y";
- _M_data->_M_date_era_format = L"%m/%d/%y";
+ _M_data->_M_date_era_format = _M_data->_M_date_format;
_M_data->_M_time_format = L"%H:%M:%S";
- _M_data->_M_time_era_format = L"%H:%M:%S";
- _M_data->_M_date_time_format = L"";
- _M_data->_M_date_time_era_format = L"";
+ _M_data->_M_time_era_format = _M_data->_M_time_format;
+ _M_data->_M_date_time_format = L"%a %b %e %T %Y";
+ _M_data->_M_date_time_era_format = _M_data->_M_date_time_format;
_M_data->_M_am = L"AM";
_M_data->_M_pm = L"PM";
_M_data->_M_am_pm_format = L"%I:%M:%S %p";
new file mode 100644
@@ -0,0 +1,37 @@
+// { dg-do run { target c++11} }
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ using Facet = std::time_get<char>;
+ const Facet& fac = std::use_facet<Facet>(std::locale::classic());
+ std::istringstream ss("Fri Jul 5 14:58:21 2019");
+ std::ios::iostate err = std::ios::goodbit;
+ std::tm tm = {};
+ fac.get(ss, Facet::iter_type(), ss, err, &tm, 'c');
+ VERIFY( err == std::ios::eofbit );
+ VERIFY( tm.tm_year == 119 );
+ VERIFY( tm.tm_mon == 6 );
+ VERIFY( tm.tm_mday == 5 );
+ VERIFY( tm.tm_wday == 5 );
+ VERIFY( tm.tm_hour == 14 );
+ VERIFY( tm.tm_min == 58 );
+ VERIFY( tm.tm_sec == 21 );
+ ss.clear();
+ ss.seekg(0);
+ ss.str(ss.str() + " non-whitespace after the datetime");
+ err = std::ios::goodbit;
+ tm = std::tm();
+ fac.get(ss, Facet::iter_type(), ss, err, &tm, 'c', 'E');
+ VERIFY( err == std::ios::goodbit );
+ VERIFY( tm.tm_year == 119 );
+ VERIFY( tm.tm_mon == 6 );
+ VERIFY( tm.tm_mday == 5 );
+ VERIFY( tm.tm_wday == 5 );
+ VERIFY( tm.tm_hour == 14 );
+ VERIFY( tm.tm_min == 58 );
+ VERIFY( tm.tm_sec == 21 );
+}
new file mode 100644
@@ -0,0 +1,37 @@
+// { dg-do run { target c++11} }
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ using Facet = std::time_get<wchar_t>;
+ const Facet& fac = std::use_facet<Facet>(std::locale::classic());
+ std::wistringstream ss(L"Fri Jul 5 14:58:21 2019");
+ std::ios::iostate err = std::ios::goodbit;
+ std::tm tm = {};
+ fac.get(ss, Facet::iter_type(), ss, err, &tm, 'c');
+ VERIFY( err == std::ios::eofbit );
+ VERIFY( tm.tm_year == 119 );
+ VERIFY( tm.tm_mon == 6 );
+ VERIFY( tm.tm_mday == 5 );
+ VERIFY( tm.tm_wday == 5 );
+ VERIFY( tm.tm_hour == 14 );
+ VERIFY( tm.tm_min == 58 );
+ VERIFY( tm.tm_sec == 21 );
+ ss.clear();
+ ss.seekg(0);
+ ss.str(ss.str() + L" non-whitespace after the datetime");
+ err = std::ios::goodbit;
+ tm = std::tm();
+ fac.get(ss, Facet::iter_type(), ss, err, &tm, 'c', 'E');
+ VERIFY( err == std::ios::goodbit );
+ VERIFY( tm.tm_year == 119 );
+ VERIFY( tm.tm_mon == 6 );
+ VERIFY( tm.tm_mday == 5 );
+ VERIFY( tm.tm_wday == 5 );
+ VERIFY( tm.tm_hour == 14 );
+ VERIFY( tm.tm_min == 58 );
+ VERIFY( tm.tm_sec == 21 );
+}