[Bug libstdc++/45896] [C++0x] Facet time_get not reading dates according to the IEEE 1003 standard.

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 13 10:05:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45896

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Another testcase from PR 71556:

#include <iostream>
#include <sstream>
#include <locale>
#include <iomanip>

int main()
{
    std::tm t = {};
    std::istringstream ss("9");
    ss.imbue(std::locale("C.UTF-8"));
    ss >> std::get_time(&t, "%H");
    if (ss.fail()) {
        std::cout << "Parse failed\n";
    } else {
        std::cout << std::put_time(&t, "%c") << '\n';
    }
}


More information about the Gcc-bugs mailing list