diff --git a/include/llvm/Support/Chrono.h b/include/llvm/Support/Chrono.h index c46ae5a32db..6118ed0476e 100644 --- a/include/llvm/Support/Chrono.h +++ b/include/llvm/Support/Chrono.h @@ -76,21 +76,15 @@ raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP); /// display unit or you request that the unit is not displayed. namespace detail { -template struct unit { static constexpr char value[] = ""; }; -template constexpr char unit::value[]; +template struct unit { static const char value[]; }; +template const char unit::value[] = ""; -template <> struct unit> { - static constexpr char value[] = "h"; -}; - -template <> struct unit> { - static constexpr char value[] = "m"; -}; - -template <> struct unit> { static constexpr char value[] = "s"; }; -template <> struct unit { static constexpr char value[] = "ms"; }; -template <> struct unit { static constexpr char value[] = "us"; }; -template <> struct unit { static constexpr char value[] = "ns"; }; +template <> struct unit> { static const char value[]; }; +template <> struct unit> { static const char value[]; }; +template <> struct unit> { static const char value[]; }; +template <> struct unit { static const char value[]; }; +template <> struct unit { static const char value[]; }; +template <> struct unit { static const char value[]; }; } // namespace detail template diff --git a/lib/Support/Chrono.cpp b/lib/Support/Chrono.cpp index ef81edc9269..ca748f5c046 100644 --- a/lib/Support/Chrono.cpp +++ b/lib/Support/Chrono.cpp @@ -16,12 +16,12 @@ namespace llvm { using namespace sys; -constexpr char detail::unit>::value[]; -constexpr char detail::unit>::value[]; -constexpr char detail::unit>::value[]; -constexpr char detail::unit::value[]; -constexpr char detail::unit::value[]; -constexpr char detail::unit::value[]; +const char detail::unit>::value[] = "h"; +const char detail::unit>::value[] = "m"; +const char detail::unit>::value[] = "s"; +const char detail::unit::value[] = "ms"; +const char detail::unit::value[] = "us"; +const char detail::unit::value[] = "ns"; static inline struct tm getStructTM(TimePoint<> TP) { struct tm Storage;