From 62a321d6dc377e0ba9c712b6a8d64360616de564 Mon Sep 17 00:00:00 2001 From: dominic <510002+dmah42@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:06:48 +0000 Subject: [PATCH] update standard to C++17 per C++ build support (#1875) * update standard to C++17 per C++ build support * disable deadcode checks from clang-tidy * fix redundant definition of constexpr --- .github/workflows/clang-tidy.yml | 2 +- BUILD.bazel | 2 +- CMakeLists.txt | 2 +- src/perf_counters.cc | 2 -- test/BUILD | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 558375e3ae..37a61cdb3a 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -35,4 +35,4 @@ jobs: - name: run shell: bash working-directory: ${{ runner.workspace }}/_build - run: run-clang-tidy + run: run-clang-tidy -checks=*,-clang-analyzer-deadcode* diff --git a/BUILD.bazel b/BUILD.bazel index 094ed62437..3451b4e758 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,7 +3,7 @@ licenses(["notice"]) COPTS = [ "-pedantic", "-pedantic-errors", - "-std=c++14", + "-std=c++17", "-Wall", "-Wconversion", "-Wextra", diff --git a/CMakeLists.txt b/CMakeLists.txt index 3aac35fe69..c90529d8b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,7 @@ if (BENCHMARK_BUILD_32_BITS) add_required_cxx_compiler_flag(-m32) endif() -set(BENCHMARK_CXX_STANDARD 14) +set(BENCHMARK_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD ${BENCHMARK_CXX_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED YES) diff --git a/src/perf_counters.cc b/src/perf_counters.cc index fc9586b716..a2fa7fe35f 100644 --- a/src/perf_counters.cc +++ b/src/perf_counters.cc @@ -26,8 +26,6 @@ namespace benchmark { namespace internal { -constexpr size_t PerfCounterValues::kMaxCounters; - #if defined HAVE_LIBPFM size_t PerfCounterValues::Read(const std::vector& leaders) { diff --git a/test/BUILD b/test/BUILD index f2179f61c1..c1ca86b5b2 100644 --- a/test/BUILD +++ b/test/BUILD @@ -10,7 +10,7 @@ platform( TEST_COPTS = [ "-pedantic", "-pedantic-errors", - "-std=c++14", + "-std=c++17", "-Wall", "-Wconversion", "-Wextra",