summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-08-31 17:03:02 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-08-31 17:03:02 +0000
commitdda6f242fb478b71b2136736fade976ccedfa82f (patch)
tree699dd03dfca7df64603c5da50d371a476d957d90 /libcxx
parent69bc206547c3b9f413673ef0ebc6e425c6dbd11a (diff)
downloadbcm5719-llvm-dda6f242fb478b71b2136736fade976ccedfa82f.tar.gz
bcm5719-llvm-dda6f242fb478b71b2136736fade976ccedfa82f.zip
Forgot to svn add the test for r189722.
llvm-svn: 189723
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp
new file mode 100644
index 00000000000..74b65d6b9cc
--- /dev/null
+++ b/libcxx/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.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// duration
+
+// template <class Rep2, class Period2>
+// duration(const duration<Rep2, Period2>& d);
+
+// overflow should SFINAE instead of error out, LWG 2094
+
+#include <chrono>
+#include <cassert>
+
+bool called = false;
+
+void f(std::chrono::milliseconds);
+void f(std::chrono::seconds)
+{
+ called = true;
+}
+
+int main()
+{
+ {
+ std::chrono::duration<int, std::exa> r(1);
+ f(r);
+ assert(called);
+ }
+}
OpenPOWER on IntegriCloud