Bug #54265
closeds3select: c++20 compilation error in boost/msm/back/state_machine.hpp
0%
Description
set CMAKE_CXX_STANDARD=20:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1157df00a19..b20e43b6bbb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -211,8 +211,8 @@ if(HAVE_INTEL)
endif()
endif()
-# require c++17
-set(CMAKE_CXX_STANDARD 17)
+# require c++20
+set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)
fails with gcc 11.2.1 and boost 1.76:
In file included from /home/cbodley/ceph/src/s3select/include/s3select_csv_parser.h:5, from /home/cbodley/ceph/src/s3select/include/s3select.h:14, from /home/cbodley/ceph/src/rgw/rgw_s3select_private.h:35, from /home/cbodley/ceph/src/rgw/rgw_s3select.cc:4: /usr/include/boost/msm/back/state_machine.hpp: At global scope: /usr/include/boost/msm/back/state_machine.hpp:1593:37: error: expected unqualified-id before ‘)’ token 1593 | state_machine<A0,A1,A2,A3,A4 >() | ^ /usr/include/boost/msm/back/state_machine.hpp:1612:15: error: expected ‘)’ before ‘const’ 1612 | (Expr const& expr,typename ::boost::enable_if<typename ::boost::proto::is_expr<Expr>::type >::type* =0) | ~ ^~~~~~ | ) /usr/include/boost/msm/back/state_machine.hpp:1690:11: error: expected ‘)’ before ‘&&’ token 1690 | >(ARG0&& t0,ARG&&... t) | ~ ^~ | ) /usr/include/boost/msm/back/state_machine.hpp:1707:11: error: expected ‘)’ before ‘const’ 1707 | >(Expr const& expr,ARG&&... t) | ~ ^~~~~~ | ) /usr/include/boost/msm/back/state_machine.hpp:1741:21: error: expected ‘)’ before ‘const’ 1741 | (library_sm const& rhs) | ~ ^~~~~~ | )
i guess it's complaining that the constructor should just be state_machine() without the extra template syntax <A0,A1,A2,A3,A4 >
clang 13 compiles this without error
Updated by Matt Benjamin about 2 years ago
- Assignee set to Gal Salomon
I think I heard that we're eliminating the dependency on boost::state_machine--its apparently a large source of CPU overhead.
Gal, can you comment?
Matt
Updated by Gal Salomon about 2 years ago
indeed,
we found that (Girjeh and myself) there is a faster(3x) alternative for boost_state_machine.
the thing is, the other CSV parser may need some "functionality backup" from boost_state_machine.
the other parser is compile-time (template), i.e. each CSV definition should define in compile-time,
while with boost it is dynamic(runtime)
we've just started with this task, we might resolve that issue also.
does s3select the only boost_state_machine user?
Updated by Casey Bodley about 2 years ago
Gal Salomon wrote:
does s3select the only boost_state_machine user?
i believe so - at least s3select was the only place i saw this compilation failure with c++20
Updated by Adam Emerson almost 2 years ago
Gal Salomon wrote:
we've just started with this task, we might resolve that issue also.
We can resolve this issue quickly just by bumping to Boost 1.77 or above.
(We should have at least 1.78 or 1.79 for coroutine functionality.)
Updated by Casey Bodley almost 2 years ago
- Status changed from New to Resolved
boost was upgraded on main with https://github.com/ceph/ceph/pull/46554