diff --git a/src/google/protobuf/util/time_util.cc b/src/google/protobuf/util/time_util.cc index 4c69b50be..ee6406d7a 100644 --- a/src/google/protobuf/util/time_util.cc +++ b/src/google/protobuf/util/time_util.cc @@ -165,14 +165,14 @@ int64_t RoundTowardZero(int64_t value, int64_t divider) { // Actually define these static const integers. Required by C++ standard (but // some compilers don't like it). #ifndef _MSC_VER -const int64_t TimeUtil::kTimestampMinSeconds; -const int64_t TimeUtil::kTimestampMaxSeconds; -const int32_t TimeUtil::kTimestampMinNanoseconds; -const int32_t TimeUtil::kTimestampMaxNanoseconds; -const int64_t TimeUtil::kDurationMaxSeconds; -const int64_t TimeUtil::kDurationMinSeconds; -const int32_t TimeUtil::kDurationMaxNanoseconds; -const int32_t TimeUtil::kDurationMinNanoseconds; +constexpr int64_t TimeUtil::kTimestampMinSeconds; +constexpr int64_t TimeUtil::kTimestampMaxSeconds; +constexpr int32_t TimeUtil::kTimestampMinNanoseconds; +constexpr int32_t TimeUtil::kTimestampMaxNanoseconds; +constexpr int64_t TimeUtil::kDurationMaxSeconds; +constexpr int64_t TimeUtil::kDurationMinSeconds; +constexpr int32_t TimeUtil::kDurationMaxNanoseconds; +constexpr int32_t TimeUtil::kDurationMinNanoseconds; #endif // !_MSC_VER std::string TimeUtil::ToString(const Timestamp& timestamp) {