Skip to content

cmake 3.21.2 set(CMAKE_CXX_STANDARD 20) incorrectly sets -std:c++20 for msvc.

cmake version 3.21.2

set(CMAKE_CXX_STANDARD 20)

sets -std:c++20

The issue is on my CI it has a newer version of cmake and an older version of msvc. On my pc I have older versions of both.

Maybe related: #18837

https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-160

In versions of Visual Studio 2019 before version 16.11, /std:c++latest is required to enable all the compiler and standard library features of C++20.

Maybe the current the version on my ci doesn't support -std maybe it needs /std

https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-by-compiler-version?view=msvc-160

Version of the MSVC compiler version 19.29.30133 which I guess is Visual Studio 2019 16.11.

Hmm the error message doesn't match the documentation on Microsoft's site...

The contents of <ranges> are available only in c++latest mode with concepts support; see https://github.com/microsoft/STL/issues/1814 for details.

failed build log. log__1_.txt

Edited by Robert Russell
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information