convert_float_to_int.fail.cpp 689 B

1234567891011121314151617181920212223242526
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // <chrono>
  9. // duration
  10. // template <class Rep2, class Period2>
  11. // duration(const duration<Rep2, Period2>& d);
  12. // conversions from floating point to integral durations disallowed
  13. #include <chrono>
  14. int main(int, char**)
  15. {
  16. std::chrono::duration<double> d;
  17. std::chrono::duration<int> i = d;
  18. return 0;
  19. }