1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 // time_point& operator+=(const duration& d);
19 #include "test_macros.h"
22 constexpr bool constexpr_test()
24 typedef std::chrono::system_clock Clock
;
25 typedef std::chrono::milliseconds Duration
;
26 std::chrono::time_point
<Clock
, Duration
> t(Duration(5));
28 return t
.time_since_epoch() == Duration(9);
35 typedef std::chrono::system_clock Clock
;
36 typedef std::chrono::milliseconds Duration
;
37 std::chrono::time_point
<Clock
, Duration
> t(Duration(3));
39 assert(t
.time_since_epoch() == Duration(5));
43 static_assert(constexpr_test(), "");