47 lines
1.6 KiB
Diff
47 lines
1.6 KiB
Diff
From 824b1101570d5a2417ef22e6a7fa358f4a0ffb9d Mon Sep 17 00:00:00 2001
|
|
From: wangzengliang <wangzengliang2@huawei.com>
|
|
Date: Fri, 21 Jul 2023 17:52:36 +0800
|
|
Subject: [PATCH] gcc12 need constexpr
|
|
|
|
---
|
|
src/common/dout.h | 4 ++--
|
|
src/libcephsqlite.cc | 4 ++--
|
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/common/dout.h b/src/common/dout.h
|
|
index 421222d53..ae52c358b 100644
|
|
--- a/src/common/dout.h
|
|
+++ b/src/common/dout.h
|
|
@@ -99,11 +99,11 @@ namespace ceph::dout {
|
|
template<typename T>
|
|
struct dynamic_marker_t {
|
|
T value;
|
|
- operator T() const { return value; }
|
|
+ constexpr operator T() const { return value; }
|
|
};
|
|
|
|
template<typename T>
|
|
-dynamic_marker_t<T> need_dynamic(T&& t) {
|
|
+constexpr dynamic_marker_t<T> need_dynamic(T&& t) {
|
|
return dynamic_marker_t<T>{ std::forward<T>(t) };
|
|
}
|
|
|
|
diff --git a/src/libcephsqlite.cc b/src/libcephsqlite.cc
|
|
index 3db64a19f..a6e8a4883 100644
|
|
--- a/src/libcephsqlite.cc
|
|
+++ b/src/libcephsqlite.cc
|
|
@@ -380,8 +380,8 @@ static int FileSize(sqlite3_file *file, sqlite_int64 *osize)
|
|
|
|
static bool parsepath(std::string_view path, struct cephsqlite_fileloc* fileloc)
|
|
{
|
|
- static const std::regex re1{"^/*(\\*[[:digit:]]+):([[:alnum:]-_.]*)/([[:alnum:]-._]+)$"};
|
|
- static const std::regex re2{"^/*([[:alnum:]-_.]+):([[:alnum:]-_.]*)/([[:alnum:]-._]+)$"};
|
|
+ static const std::regex re1{"^/*(\\*[[:digit:]]+):([[:alnum:]\\-_.]*)/([[:alnum:]\\-._]+)$"};
|
|
+ static const std::regex re2{"^/*([[:alnum:]\\-_.]+):([[:alnum:]\\-_.]*)/([[:alnum:]\\-._]+)$"};
|
|
|
|
std::cmatch cm;
|
|
if (!std::regex_match(path.data(), cm, re1)) {
|
|
--
|
|
2.27.0
|
|
|