CppTools: Code model fix for C++20, MSVC, and newer CMake versions

Starting with version 3.20 CMake adds -std:c++20, which breaks the
code model when using MSVC.

Clang-cl 12 doesn't know about -std:c++20, but clang driver knows
about -std=c++20.

Fixes: QTCREATORBUG-26146
Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2021-08-19 16:27:54 +02:00
parent dc8801e495
commit 54c5322322
5 changed files with 28 additions and 9 deletions

View File

@@ -122,7 +122,8 @@ QString Utils::toString(::Utils::LanguageVersion languageVersion)
CASE_LANGUAGEVERSION(CXX11);
CASE_LANGUAGEVERSION(CXX14);
CASE_LANGUAGEVERSION(CXX17);
CASE_LANGUAGEVERSION(CXX2a);
CASE_LANGUAGEVERSION(CXX20);
CASE_LANGUAGEVERSION(CXX2b);
// no default to get a compiler warning if anything is added
}
#undef CASE_LANGUAGEVERSION