From 8ecb95fdec497a8440ac19c9e961b8d87cc2d668 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 31 Aug 2013 17:03:02 +0000 Subject: [PATCH] Forgot to svn add the test for r189722. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189723 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../convert_overflow.pass.cpp | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp diff --git a/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp b/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp new file mode 100644 index 00000000..74b65d6b --- /dev/null +++ b/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// duration + +// template +// duration(const duration& d); + +// overflow should SFINAE instead of error out, LWG 2094 + +#include +#include + +bool called = false; + +void f(std::chrono::milliseconds); +void f(std::chrono::seconds) +{ + called = true; +} + +int main() +{ + { + std::chrono::duration r(1); + f(r); + assert(called); + } +}