31 lines · cpp
1//===----------------------------------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8// UNSUPPORTED: c++03, c++11, c++14, c++179 10// <chrono>11 12// template <class Duration> class hh_mm_ss;13// If Duration is not an instance of duration, the program is ill-formed.14 15#include <chrono>16#include <string>17#include <cassert>18#include "test_macros.h"19 20struct A {};21 22int main(int, char**)23{24 std::chrono::hh_mm_ss<void> h0; // expected-error-re@*:* {{static assertion failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}25 std::chrono::hh_mm_ss<int> h1; // expected-error-re@*:* {{static assertion failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}26 std::chrono::hh_mm_ss<std::string> h2; // expected-error-re@*:* {{static assertion failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}27 std::chrono::hh_mm_ss<A> h3; // expected-error-re@*:* {{static assertion failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}28 29 return 0;30}31