Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with gcc 8.2.0 parse.pass.cpp fails at line 48 #388

Closed
binnacle opened this issue Sep 15, 2018 · 2 comments
Closed

with gcc 8.2.0 parse.pass.cpp fails at line 48 #388

binnacle opened this issue Sep 15, 2018 · 2 comments

Comments

@binnacle
Copy link

FYI

date_test_pass_parse_bin: /w/gpl/cpp20-date-20180915/test/date_test/parse.pass.cpp:48: void test_a(): Assertion `!in.fail()' failed.

  {
    // correct abbreviation
    std::istringstream in{"Sun 2016-12-11"};
    sys_days tp;
    in >> parse("%A %F", tp);
    assert(!in.fail());   # throws here
    assert(!in.bad());
    assert(!in.eof());
    assert(tp == 2016_y/12/11);
  }

gcc 8.2.0 along with prerequisites built on old distro, should not matter but if not reproducible contact me as needed for details

Thank you for your great contribution!

@HowardHinnant
Copy link
Owner

Here are the gcc bug reports that cause this failure:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78714
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86967
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71557

They can be worked around in date.h if you are ok with being limited to the "C" locale by compiling date.h with -DONLY_C_LOCALE=1. This flag circumvents use of the std::time_get` facet and rolls its own in date.h.

This is a common enough report that I should probably include this information in comments in parse.pass.cpp.

@binnacle
Copy link
Author

Thank you for the workaround, though I'm a new user and have not yet reached a need for the impacted parse() behavior. Searched here but missed closed tickets, thought perhaps it was a problem related to the target system libraries or a gcc 8.2 regression.

A comment in either the unit test or the script would help save others trouble going forward, perhaps hold this ticket open till one is in place.

Congratulations on date.h being voted into ++20, really like using it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants