diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91927c072de..c976f362404 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -78,7 +78,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) if(HAS_FORTIFY_SOURCE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2") endif() endif() CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT) @@ -140,15 +140,15 @@ else(no_yasm) endif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64") endif(no_yasm) -# require c++11 +# require c++14 if(CMAKE_VERSION VERSION_LESS "3.1") include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) - if(NOT COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) + if(NOT COMPILER_SUPPORTS_CXX14) message(FATAL_ERROR - "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") + "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support.") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") include(CheckCCompilerFlag) CHECK_C_COMPILER_FLAG("-std=gnu99" COMPILER_SUPPORTS_GNU99) if(NOT COMPILER_SUPPORTS_GNU99) @@ -157,7 +157,7 @@ if(CMAKE_VERSION VERSION_LESS "3.1") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") else() - set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD 99) diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index b2f480cb2c7..795e960e1ad 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -577,7 +577,7 @@ C_OrderedThrottle *OrderedThrottle::start_op(Context *on_finish) { auto l = uniquely_lock(m_lock); uint64_t tid = m_next_tid++; m_tid_result[tid] = Result(on_finish); - auto ctx = make_unique(this, tid); + auto ctx = std::make_unique(this, tid); complete_pending_ops(l); while (m_max == m_current) { diff --git a/src/rgw/rgw_iam_policy.cc b/src/rgw/rgw_iam_policy.cc index 0b967716ae2..c6666cb652c 100644 --- a/src/rgw/rgw_iam_policy.cc +++ b/src/rgw/rgw_iam_policy.cc @@ -878,7 +878,7 @@ bool ParseState::obj_start() { if (w->objectable && !objecting) { objecting = true; if (w->id == TokenID::Statement) { - pp->policy.statements.push_back({}); + pp->policy.statements.emplace_back(); } return true;