fix compile with gcc12
This commit is contained in:
parent
3dadda505f
commit
ed44de8907
46
0020-compiled-with-gcc12.patch
Normal file
46
0020-compiled-with-gcc12.patch
Normal file
@ -0,0 +1,46 @@
|
||||
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
|
||||
|
||||
@ -166,6 +166,7 @@ Patch16: 0016-fix-mgr-dashboard-frontend-build-depend.patch
|
||||
Patch17: 0017-mgr-dashboard-support-multi-language.patch
|
||||
Patch18: 0018-Fix-Python-3.10-PEP-620-incompatibility.patch
|
||||
Patch19: 0019-include-memory.patch
|
||||
Patch20: 0020-compiled-with-gcc12.patch
|
||||
%if 0%{?suse_version}
|
||||
# _insert_obs_source_lines_here
|
||||
ExclusiveArch: x86_64 aarch64 ppc64le s390x
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user