Opened 10 years ago
Closed 10 years ago
#7546 closed Bugs (fixed)
time_point<system_clock> output version 2 fails to compile
Reported by: | viboes | Owned by: | viboes |
---|---|---|---|
Milestone: | Boost 1.53.0 | Component: | chrono |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Unfortunately I had commented the test for time_point<system_clock> and while uncommenting it there is a severe compile error.
clang-darwin.compile.c++ ../../../bin.v2/libs/chrono/test/time_point_output_h.test/clang-darwin-3.1x/debug/io/time_point_output.o In file included from io/time_point_output.cpp:5: In file included from ../../../boost/chrono/chrono_io.hpp:26: ../../../boost/chrono/io/time_point_io.hpp:415:46: error: no viable conversion from 'const time_point<boost::chrono::system_clock, boost::chrono::duration<long long, boost::ratio<1, 30> > >' to 'const time_point' (aka 'const time_point<boost::chrono::system_clock>') time_t t = system_clock::to_time_t(tp); ^~ io/time_point_output.cpp:17:7: note: in instantiation of function template specialization 'boost::chrono::operator<<<char, std::char_traits<char>, boost::chrono::duration<long long, boost::ratio<1, 30> > >' requested here out << tp; ^ io/time_point_output.cpp:69:3: note: in instantiation of function template specialization 'test_good_prefix<boost::chrono::system_clock, boost::chrono::duration<long long, boost::ratio<1, 30> > >' requested here test_good_prefix<Clock> ("2 [1/30]seconds", duration<boost::int_least64_t, ratio<1, 30> > (2)); ^ io/time_point_output.cpp:94:3: note: in instantiation of function template specialization 'check_all<boost::chrono::system_clock>' requested here check_all<boost::chrono::system_clock>(); ^ ../../../boost/chrono/time_point.hpp:156:11: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const time_point<boost::chrono::system_clock, boost::chrono::duration<long long, boost::ratio<1, 30> > >' to 'const boost::chrono::time_point<boost::chrono::system_clock, boost::chrono::duration<long long, boost::ratio<1, 1000000000> > > &' for 1st argument; class time_point ^ ../../../boost/chrono/time_point.hpp:181:9: note: candidate template ignored: substitution failure [with Duration2 = boost::chrono::duration<long long, boost::ratio<1, 30> >] time_point(const time_point<clock, Duration2>& t ^ ../../../boost/chrono/detail/inlined/mac/chrono.hpp:53:43: note: passing argument to parameter 't' here system_clock::to_time_t(const time_point& t) BOOST_NOEXCEPT ^ 1 error generated. "/Users/viboes/clang/clang+llvm-3.1-x86_64-apple-darwin11/bin/clang++" -x c++ -std=c++11 -O0 -g -Wextra -Wno-long-long -pedantic -O0 -fno-inline -Wall -pedantic -g -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_HEADER_ONLY -DBOOST_CHRONO_USES_MPL_ASSERT -DBOOST_CHRONO_VERSION=2 -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -I"../../.." -c -o "../../../bin.v2/libs/chrono/test/time_point_output_h.test/clang-darwin-3.1x/debug/io/time_point_output.o" "io/time_point_output.cpp"
Attachments (2)
Change History (8)
by , 10 years ago
Attachment: | 7546.patch added |
---|
comment:1 by , 10 years ago
Milestone: | To Be Determined → Boost 1.52.0 |
---|---|
Version: | Boost 1.51.0 → Boost Release Branch |
Committed in trunk revision [81040].
comment:2 by , 10 years ago
Status: | new → assigned |
---|
by , 10 years ago
Attachment: | 7546_7547_disabler.patch added |
---|
I don't find how to fix this for now. This patch that disable the specific time_point<system_clock,D> i/o.
comment:3 by , 10 years ago
Milestone: | Boost 1.52.0 → To Be Determined |
---|
Committed in trunk revision [81045].
comment:4 by , 10 years ago
Severity: | Showstopper → Problem |
---|---|
Version: | Boost Release Branch → Boost 1.52.0 |
Merged from trunk [81056]. Moved to Problem after disabling the cause.
comment:5 by , 10 years ago
Milestone: | To Be Determined → Boost 1.53.0 |
---|
Rolled back after fixing.
svn diff boost/chrono Index: boost/chrono/config.hpp =================================================================== --- boost/chrono/config.hpp (revision 82527) +++ boost/chrono/config.hpp (working copy) @@ -28,7 +28,7 @@ #if ! defined BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT \ && ! defined BOOST_CHRONO_DONT_PROVIDE_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT -# define BOOST_CHRONO_DONT_PROVIDE_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT +# define BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT #endif Index: boost/chrono/io/time_point_io.hpp =================================================================== --- boost/chrono/io/time_point_io.hpp (revision 82527) +++ boost/chrono/io/time_point_io.hpp (working copy) @@ -936,6 +936,7 @@ { '%', 'Y', '-', '%', 'm', '-', '%', 'd', ' ', '%', 'H', ':', '%', 'M', ':' }; pb = pattern; pe = pb + sizeof (pattern) / sizeof(CharT); + tm.tm_sec=0; #if defined BOOST_CHRONO_USES_INTERNAL_TIME_GET const detail::time_get<CharT>& dtg(tg); dtg.get(is, 0, is, err, &tm, pb, pe);
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
This patch fixes the compile issue and refactor the tests.