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 // static constexpr duration max(); // noexcept after C++17
19 #include "test_macros.h"
20 #include "../../rep.h"
25 LIBCPP_ASSERT_NOEXCEPT(std::chrono::duration_values
<typename
D::rep
>::max());
27 ASSERT_NOEXCEPT( std::chrono::duration_values
<typename
D::rep
>::max());
30 typedef typename
D::rep DRep
;
31 DRep max_rep
= std::chrono::duration_values
<DRep
>::max();
32 assert(D::max().count() == max_rep
);
34 #if TEST_STD_VER >= 11
36 typedef typename
D::rep DRep
;
37 constexpr DRep max_rep
= std::chrono::duration_values
<DRep
>::max();
38 static_assert(D::max().count() == max_rep
, "");
45 test
<std::chrono::duration
<int> >();
46 test
<std::chrono::duration
<Rep
> >();