From d396d46bd1d94c0cf318ea153af9eb573214565e Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Thu, 18 Feb 2021 18:12:53 +0000 Subject: [PATCH] let's test if all the buildbots are happy with C++17 it's stil a bit too early for C++20 --- CMakeLists.txt | 2 +- scripts/mk_util.py | 10 +++++----- src/util/vector.h | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 622d0a198..2e74415db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,7 +188,7 @@ include(${PROJECT_SOURCE_DIR}/cmake/z3_add_cxx_flag.cmake) ################################################################################ # C++ language version ################################################################################ -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ################################################################################ diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 1af4f7c08..f6a4e3a65 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -1917,11 +1917,11 @@ class MLComponent(Component): src_dir = self.to_src_dir mk_dir(os.path.join(BUILD_DIR, self.sub_dir)) api_src = get_component(API_COMPONENT).to_src_dir - # remove /GL and -std=c++11; the ocaml tools don't like them. - if IS_WINDOWS: + # remove /GL and -std=c++17; the ocaml tools don't like them. + if IS_WINDOWS: out.write('CXXFLAGS_OCAML=$(CXXFLAGS:/GL=)\n') else: - out.write('CXXFLAGS_OCAML=$(subst -std=c++11,,$(CXXFLAGS))\n') + out.write('CXXFLAGS_OCAML=$(subst -std=c++17,,$(CXXFLAGS))\n') substitutions = { 'VERSION': "{}.{}.{}.{}".format(VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) } @@ -2476,7 +2476,7 @@ def mk_config(): CPPFLAGS = '%s -D_MP_INTERNAL' % CPPFLAGS if GIT_HASH: CPPFLAGS = '%s -DZ3GITHASH=%s' % (CPPFLAGS, GIT_HASH) - CXXFLAGS = '%s -std=c++11' % CXXFLAGS + CXXFLAGS = '%s -std=c++17' % CXXFLAGS CXXFLAGS = '%s -fvisibility=hidden -c' % CXXFLAGS FPMATH = test_fpmath(CXX) CXXFLAGS = '%s %s' % (CXXFLAGS, FPMATH_FLAGS) @@ -2568,7 +2568,7 @@ def mk_config(): config.write('CC=%s\n' % CC) config.write('CXX=%s\n' % CXX) config.write('CXXFLAGS=%s %s\n' % (CPPFLAGS, CXXFLAGS)) - config.write('CFLAGS=%s %s\n' % (CPPFLAGS, CXXFLAGS.replace('-std=c++11', ''))) + config.write('CFLAGS=%s %s\n' % (CPPFLAGS, CXXFLAGS.replace('-std=c++17', ''))) config.write('EXAMP_DEBUG_FLAG=%s\n' % EXAMP_DEBUG_FLAG) config.write('CXX_OUT_FLAG=-o \n') config.write('C_OUT_FLAG=-o \n') diff --git a/src/util/vector.h b/src/util/vector.h index ef2ec2cd3..08f7940a1 100644 --- a/src/util/vector.h +++ b/src/util/vector.h @@ -79,11 +79,7 @@ class vector { throw default_exception("Overflow encountered when expanding vector"); } SZ *mem, *old_mem = reinterpret_cast(m_data) - 2; -#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5 - if (__has_trivial_copy(T)) { -#else if (std::is_trivially_copyable::value) { -#endif mem = (SZ*)memory::reallocate(old_mem, new_capacity_T); m_data = reinterpret_cast(mem + 2); } else {