From 5e9a9aa5ef75f0c6bae35ae11e01dd1befbc0ae5 Mon Sep 17 00:00:00 2001 From: Andreea Isac <48239328+andreeis@users.noreply.github.com> Date: Mon, 25 Oct 2021 14:37:11 -0700 Subject: [PATCH] Fix C standard reroute for c2x and update changelog. (#2205) * Fix C standard reroute for c2x and update changelog. * Changelog update --- CHANGELOG.md | 5 +++-- src/cpptools.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b36f5d..3322de36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ Bug fixes: - `CMake: Compile Active File` command stopped working in v1.9.0. [#2180](https://github.com/microsoft/vscode-cmake-tools/issues/2180) - Exception after successful build when cpptools IntelliSense is disabled. [#2188](https://github.com/microsoft/vscode-cmake-tools/issues/2188) - Fix issue with presets (v3) and "toolchainFile". [#2179](https://github.com/microsoft/vscode-cmake-tools/issues/2179) -- Don't add `-j` argument when `cmake.parallelJobs` is set to `1`. [#2187](https://github.com/microsoft/vscode-cmake-tools/issues/2187) [@mark-ulrich](https://github.com/mark-ulrich) +- Don't add `-j` argument when `cmake.parallelJobs` is set to `1`. [#1958](https://github.com/microsoft/vscode-cmake-tools/issues/1958) [@mark-ulrich](https://github.com/mark-ulrich) +- Warn the user about CMAKE_BUILD_TYPE inconsistencies. [#2096](https://github.com/microsoft/vscode-cmake-tools/issues/2096) ## 1.9.0 Improvements: @@ -31,7 +32,7 @@ Bug fixes: - Regression with Visual Studio generator and non-default toolset. [#2147](https://github.com/microsoft/vscode-cmake-tools/issues/2147) - Debug shows "No compiler found in cache file." dialog. [#2121](https://github.com/microsoft/vscode-cmake-tools/issues/2121) - Unable to work with pre-configured projects (cache is deleted). [#2140](https://github.com/microsoft/vscode-cmake-tools/issues/2140) -- Unknown C++ standard control flag: -std=gnu++2b. [#2150](https://github.com/microsoft/vscode-cmake-tools/issues/2150) +- Unknown C/C++ standard control flags: -std=gnu++2b and -std=c2x. [#2150](https://github.com/microsoft/vscode-cmake-tools/issues/2150) - Select the most recently used build/test preset when configure preset changes. [#1927](https://github.com/microsoft/vscode-cmake-tools/issues/1927) - Re-enable build target selection when using presets. [#1872](https://github.com/microsoft/vscode-cmake-tools/issues/1872) diff --git a/src/cpptools.ts b/src/cpptools.ts index d3d55df6..79e95589 100644 --- a/src/cpptools.ts +++ b/src/cpptools.ts @@ -92,7 +92,7 @@ function parseCStandard(std: string, can_use_gnu: boolean): StandardVersion { return is_gnu ? 'gnu99' : 'c99'; } else if (/(c|gnu)(11|1x|iso9899:2011)/.test(std)) { return is_gnu ? 'gnu11' : 'c11'; - } else if (/(c|gnu)(17|18|iso9899:(2017|2018))/.test(std)) { + } else if (/(c|gnu)(17|18|2x|iso9899:(2017|2018))/.test(std)) { if (can_use_gnu) { // cpptools supports 'c17' in same version it supports GNU std. return is_gnu ? 'gnu17' : 'c17';