Skip to content

Commit 75278d7

Browse files
authored
[win] Increase CXX_STANDARD_STRING with VS 2026 (#20398)
* [win] Increase CXX_STANDARD_STRING with VS 2026 Use `/std:c++20` by default with Visual Studio 2026 * Fix compilation error with /std:c++20 * Add missing #include with /std:c++20
1 parent fcf1cdc commit 75278d7

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

cmake/modules/CheckCompiler.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ endif()
162162
# so we check the value of __cplusplus.
163163
# This default value can be overridden by specifying one at the prompt.
164164
if (MSVC)
165-
set(CXX_STANDARD_STRING "201703L")
165+
if(MSVC_VERSION GREATER_EQUAL 1950)
166+
set(CXX_STANDARD_STRING "202002L")
167+
else()
168+
set(CXX_STANDARD_STRING "201703L")
169+
endif()
166170
else()
167171
execute_process(COMMAND echo __cplusplus
168172
COMMAND ${CMAKE_CXX_COMPILER} -E -x c++ -

io/io/test/TFileTests.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <memory>
22
#include <vector>
33
#include <string>
4+
#include <array>
45

56
#include "gtest/gtest.h"
67

roottest/root/io/evolution/rules/execSourceTypes.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <type_traits>
99
#include <list>
1010
#include <string>
11+
#include <array>
1112

1213
struct A {
1314
float f = 1.1;

0 commit comments

Comments
 (0)