Skip to content

MSVC: Use /std: instead of -std:

Nils Gladitz requested to merge nilsgladitz/cmake:std-for-clang-tidy into master

MSVC itself has no obvious issues with either variant but e.g. clang-tidy currently only seems to recognize the former.

Prefer it since it is also happens to be the officially documented syntax.

Option documentation is at: https://docs.microsoft.com/en-gb/cpp/build/reference/std-specify-language-standard-version

The clang-tidy version I tested with was 6.0.1.

The diagnostic it produced for the former variant is: error: unknown argument: '-std:c++17' [clang-diagnostic-error]

Merge request reports