From 72bbe28ad8744d6d3c7490881e35ce3dafddfc18 Mon Sep 17 00:00:00 2001 From: wanglinke Date: Thu, 26 Jun 2025 17:48:19 +0800 Subject: [PATCH] src/common: fix from_iso_8601 had no exception define - from_iso_8601 may actually throw exceptions, causing the program to terminate. Signed-off-by: Wang Linke --- src/common/iso_8601.cc | 2 +- src/common/iso_8601.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/iso_8601.cc b/src/common/iso_8601.cc index 74c8aeafbe8b..9d45fadf510e 100644 --- a/src/common/iso_8601.cc +++ b/src/common/iso_8601.cc @@ -49,7 +49,7 @@ optional calculate(const tm& t, uint32_t n = 0) { } optional from_iso_8601(const string_view s, - const bool ws_terminates) noexcept { + const bool ws_terminates) { auto end = s.cend(); auto read_digit = [end](sriter& c) mutable { if (c == end) { diff --git a/src/common/iso_8601.h b/src/common/iso_8601.h index 430e584ab944..dcdf324557a4 100644 --- a/src/common/iso_8601.h +++ b/src/common/iso_8601.h @@ -30,7 +30,7 @@ namespace ceph { // If a date is invalid, boost::none is returned. boost::optional from_iso_8601( - std::string_view s, const bool ws_terminates = true) noexcept; + std::string_view s, const bool ws_terminates = true); enum class iso_8601_format { Y, YM, YMD, YMDh, YMDhm, YMDhms, YMDhmsn -- 2.47.3