ratio.fail.cpp 698 B

12345678910111213141516171819202122232425262728293031
  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. // Period shall be a specialization of ratio, diagnostic required.
  11. #include <chrono>
  12. template <int N, int D = 1>
  13. class Ratio
  14. {
  15. public:
  16. static const int num = N;
  17. static const int den = D;
  18. };
  19. int main(int, char**)
  20. {
  21. typedef std::chrono::duration<int, Ratio<1> > D;
  22. D d;
  23. return 0;
  24. }