]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: Uplevel to C++14
authorAdam C. Emerson <aemerson@redhat.com>
Sat, 9 Dec 2017 04:34:59 +0000 (23:34 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 14 Dec 2017 03:39:52 +0000 (22:39 -0500)
Fix a couple problems.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/CMakeLists.txt
src/common/Throttle.cc
src/rgw/rgw_iam_policy.cc

index 91927c072deb31386e0cd680bb9ab8fc41a6d3f6..c976f362404c96940688368402fc9f4423b2f4d8 100644 (file)
@@ -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)
index b2f480cb2c79b43845da283f95bf5093bb162fe7..795e960e1ad6f065a9c0d2b2731e0feb88e24759 100644 (file)
@@ -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<C_OrderedThrottle>(this, tid);
+  auto ctx = std::make_unique<C_OrderedThrottle>(this, tid);
 
   complete_pending_ops(l);
   while (m_max == m_current) {
index 0b967716ae287e693a96a9a4fce0ddf3be9443a8..c6666cb652cd130fe4ad92c00f7409e19118efae 100644 (file)
@@ -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;