summaryrefslogtreecommitdiffstats
path: root/libcxx/include/chrono
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-08-29 23:02:15 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-08-29 23:02:15 +0000
commitd0ab67f7d02023482c5dc06fcc14ea8488929684 (patch)
treee156128cfb602125efeedc531e33516f4b7d28cb /libcxx/include/chrono
parent9397c2a23b3ec6bce89bb872f3934e56586ca3db (diff)
downloadbcm5719-llvm-d0ab67f7d02023482c5dc06fcc14ea8488929684.tar.gz
bcm5719-llvm-d0ab67f7d02023482c5dc06fcc14ea8488929684.zip
Last week, someone noted that a couple of the time_point member functions were not constexpr. I looked, and they were right. They were made constexpr in p0505, so I looked at all the other bits in that paper to make sure that I didn't miss anything else. There were a couple methods in the synopsis that should have been marked constexpr, but the code was correct.
llvm-svn: 340992
Diffstat (limited to 'libcxx/include/chrono')
-rw-r--r--libcxx/include/chrono26
1 files changed, 14 insertions, 12 deletions
diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index f0bd6aff2b7..b9709b37365 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -77,16 +77,18 @@ public:
constexpr common_type<duration>::type operator+() const;
constexpr common_type<duration>::type operator-() const;
- constexpr duration& operator++();
- constexpr duration operator++(int);
- constexpr duration& operator--();
- constexpr duration operator--(int);
+ constexpr duration& operator++(); // constexpr in C++17
+ constexpr duration operator++(int); // constexpr in C++17
+ constexpr duration& operator--(); // constexpr in C++17
+ constexpr duration operator--(int); // constexpr in C++17
- constexpr duration& operator+=(const duration& d);
- constexpr duration& operator-=(const duration& d);
+ constexpr duration& operator+=(const duration& d); // constexpr in C++17
+ constexpr duration& operator-=(const duration& d); // constexpr in C++17
- duration& operator*=(const rep& rhs);
- duration& operator/=(const rep& rhs);
+ duration& operator*=(const rep& rhs); // constexpr in C++17
+ duration& operator/=(const rep& rhs); // constexpr in C++17
+ duration& operator%=(const rep& rhs); // constexpr in C++17
+ duration& operator%=(const duration& rhs); // constexpr in C++17
// special values
@@ -127,8 +129,8 @@ public:
// arithmetic
- time_point& operator+=(const duration& d);
- time_point& operator-=(const duration& d);
+ time_point& operator+=(const duration& d); // constexpr in C++17
+ time_point& operator-=(const duration& d); // constexpr in C++17
// special values
@@ -1355,8 +1357,8 @@ public:
// arithmetic
- _LIBCPP_INLINE_VISIBILITY time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
- _LIBCPP_INLINE_VISIBILITY time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
// special values
OpenPOWER on IntegriCloud