Opened 5 years ago
Closed 5 years ago
#13150 closed Bugs (worksforme)
Exception thrown when adding long duration to a date
Reported by: | Owned by: | James E. King, III | |
---|---|---|---|
Milestone: | Boost 1.67.0 | Component: | date_time |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | Cc: |
Description
This code throws an exception:
int main(void) { boost::gregorian::date d1(1500, 6, 1); boost::gregorian::date d2(4500, 6, 1); const auto duration = boost::gregorian::years(3000); std::cout << d1 << " + " << duration.number_of_years() << "Y\n"; const auto d3 = d1 + duration; // this throws std::cout << d3 << "\n"; }
Using boost-1.59 under Windows, Visual Studio 2015 64-bit.
Change History (2)
comment:1 by , 5 years ago
Owner: | changed from | to
---|
comment:2 by , 5 years ago
Milestone: | To Be Determined → Boost 1.67.0 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I added the code to one of the date_time unit tests (and validated that d3 == d2), and it runs okay on Visual Studio 2015, 32 and 64-bit, debug and release, also on msvc-14.1 and on gcc. There's a chance this was fixed in 1.67.0 with the 32-bit issues resolved.
As such I am marking it as "worksforme".