Modify

Ticket #7546 (closed Bugs: fixed)

Opened 18 months ago

Last modified 15 months ago

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

7546.patch Download (10.7 KB) - added by viboes 18 months ago.
This patch fixes the compile issue and refactor the tests.
7546_7547_disabler.patch Download (3.9 KB) - added by viboes 18 months ago.
I don't find how to fix this for now. This patch that disable the specific time_point<system_clock,D> i/o.

Change History

Changed 18 months ago by viboes

This patch fixes the compile issue and refactor the tests.

comment:1 Changed 18 months ago by viboes

  • Version changed from Boost 1.51.0 to Boost Release Branch
  • Milestone changed from To Be Determined to Boost 1.52.0

Committed in trunk revision [81040].

comment:2 Changed 18 months ago by viboes

  • Status changed from new to assigned

Changed 18 months ago by viboes

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 Changed 18 months ago by viboes

  • Milestone changed from Boost 1.52.0 to To Be Determined

Committed in trunk revision [81045].

comment:4 Changed 18 months ago by viboes

  • Version changed from Boost Release Branch to Boost 1.52.0
  • Severity changed from Showstopper to Problem

Merged from trunk [81056]. Moved to Problem after disabling the cause.

comment:5 Changed 15 months ago by anonymous

  • Milestone changed from To Be Determined to 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 Changed 15 months ago by viboes

  • Status changed from assigned to closed
  • Resolution set to fixed

Changeset [82612] Chrono: merge [82562][82663].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.