Fix a bug in std::chrono::abs where it would fail when the duration's period had not been reduced.s

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367120 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/chrono b/include/chrono
index 06fa658..51722ad 100644
--- a/include/chrono
+++ b/include/chrono
@@ -1428,7 +1428,7 @@
 >::type
 abs(duration<_Rep, _Period> __d)
 {
-    return __d >= __d.zero() ? __d : -__d;
+    return __d >= __d.zero() ? +__d : -__d;
 }
 #endif
 
diff --git a/test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp b/test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp
index 605e27c..8f5544f 100644
--- a/test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp
@@ -49,5 +49,11 @@
     static_assert(h2.count() == 3, "");
     }
 
+    {
+//  Make sure it works for durations that are not LCD'ed - example from LWG3091
+    constexpr auto d = std::chrono::abs(std::chrono::duration<int, std::ratio<60, 100>>{2});
+    static_assert(d.count() == 2, "");
+    }
+
   return 0;
 }