From 944d4ac76aae4c50690acb6c2e2cca7276c494e7 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Sun, 3 Nov 2024 17:59:45 +0000 Subject: [PATCH 1/3] update standard to C++17 per C++ build support --- BUILD.bazel | 2 +- CMakeLists.txt | 2 +- test/BUILD | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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/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", From bb7f9ad256dc664051c19f7aea3c96dada33ad62 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Sun, 3 Nov 2024 18:12:07 +0000 Subject: [PATCH 2/3] disable deadcode checks from clang-tidy --- .github/workflows/clang-tidy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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* From 7339256ca0ad299cb092e7886f8714fb4300d246 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Sun, 3 Nov 2024 18:31:21 +0000 Subject: [PATCH 3/3] fix redundant definition of constexpr --- src/perf_counters.cc | 2 -- 1 file changed, 2 deletions(-) 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) {