summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/time
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-11-14 18:22:19 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-11-14 18:22:19 +0000
commit1c7fe126ee16857243738ebc1dbaea69caffefb1 (patch)
tree9ccb4a534b61893d510b4ab870a93892479b92a6 /libcxx/test/std/utilities/time
parentccf2fa1cb64f8b292cfbe964905c4a802fb6dd87 (diff)
downloadbcm5719-llvm-1c7fe126ee16857243738ebc1dbaea69caffefb1.tar.gz
bcm5719-llvm-1c7fe126ee16857243738ebc1dbaea69caffefb1.zip
Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
llvm-svn: 286858
Diffstat (limited to 'libcxx/test/std/utilities/time')
-rw-r--r--libcxx/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp b/libcxx/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp
index 4c681fa32e5..978f09d66bb 100644
--- a/libcxx/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp
@@ -20,6 +20,17 @@
#include "test_macros.h"
+template <class D>
+void test2739() // LWG2739
+{
+ typedef std::chrono::time_point<std::chrono::system_clock> TimePoint;
+ typedef std::chrono::duration<D> Dur;
+ const Dur d(5);
+ TimePoint t0 = std::chrono::system_clock::from_time_t(200);
+ TimePoint t1 = t0 - d;
+ assert(t1 < t0);
+}
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -37,4 +48,6 @@ int main()
static_assert(t2.time_since_epoch() == Duration2(2995), "");
}
#endif
+ test2739<int32_t>();
+ test2739<uint32_t>();
}
OpenPOWER on IntegriCloud