Skip to content

Commit 151a1ce

Browse files
committed
Set C++ standard to C++20 for Clang builds
Updated the CMake configuration to use C++20 when building with Clang on MSVC. Also included the `<compare>` header in tests and adjusted formatting for improved readability.
1 parent 2e36d52 commit 151a1ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmake/configure.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
2323
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" )
2424

2525
if ( MSVC AND (CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
26-
set( CMAKE_CXX_STANDARD 17 )
26+
set( CMAKE_CXX_STANDARD 20 )
2727
else ()
2828
set( CMAKE_CXX_STANDARD 23 )
2929
endif ()

tasks/example/tests/functional/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <gtest/gtest.h>
22

3+
#include <compare>
34
#include <cstddef>
45
#include <cstdint>
56
#include <stb_library.hpp>
@@ -45,7 +46,7 @@ class NesterovARunFuncTests : public ppc::util::BaseRunFuncTests<InType, OutType
4546

4647
TestType params = std::get<ppc::util::GTestParamIndex::kTestParams>(GetParam());
4748
const auto k_count = static_cast<std::vector<int>::size_type>(((width + height) / std::get<0>(params)) *
48-
std::stoi(std::get<1>(params)));
49+
std::stoi(std::get<1>(params)));
4950
input_data_ = InType(k_count * k_count, 0);
5051
for (std::vector<int>::size_type i = 0; i < k_count; i++) {
5152
input_data_[(i * k_count) + i] = 1;

0 commit comments

Comments
 (0)