diff options
Diffstat (limited to 'test/std/utilities/time/time.point/time.point.cons/convert.fail.cpp')
-rw-r--r-- | test/std/utilities/time/time.point/time.point.cons/convert.fail.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/std/utilities/time/time.point/time.point.cons/convert.fail.cpp b/test/std/utilities/time/time.point/time.point.cons/convert.fail.cpp new file mode 100644 index 0000000000000..565aa6c4f52f2 --- /dev/null +++ b/test/std/utilities/time/time.point/time.point.cons/convert.fail.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <chrono> + +// time_point + +// template <class Duration2> +// time_point(const time_point<clock, Duration2>& t); + +// Duration2 shall be implicitly convertible to duration. + +#include <chrono> + +int main() +{ + typedef std::chrono::system_clock Clock; + typedef std::chrono::milliseconds Duration1; + typedef std::chrono::microseconds Duration2; + { + std::chrono::time_point<Clock, Duration2> t2(Duration2(3)); + std::chrono::time_point<Clock, Duration1> t1 = t2; + } +} |