Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpptools] Unknown C++ standard control flag: -std=c++23 #2475

Closed
sweemer opened this issue Apr 3, 2022 · 6 comments
Closed

[cpptools] Unknown C++ standard control flag: -std=c++23 #2475

sweemer opened this issue Apr 3, 2022 · 6 comments
Labels
bug a bug in the product Feature: cpptools integration fixed (release pending) fixed in pre-release and is pending official release
Projects
Milestone

Comments

@sweemer
Copy link
Contributor

sweemer commented Apr 3, 2022

Brief Issue Summary

When compiling a CMake project with CMAKE_CXX_STANDARD=23 I see [cpptools] Unknown C++ standard control flag: -std=c++23 in the CMake/Build output.

CMake Tools Diagnostics

{
"os": "linux",
"vscodeVersion": "1.66.0",
"cmtVersion": "1.10.5",
"configurations": [
{
"folder": "/home/sweemer/QuantLib",
"cmakeVersion": "3.22.3",
"configured": true,
"generator": "Unix Makefiles",
"usesPresets": true,
"compilers": {
"CXX": "g++-11"
}
}
],
"cpptoolsIntegration": {
"isReady": true,
"hasCodeModel": true,
"activeBuildType": "Debug",
"buildTypesSeen": [
"Debug"
],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 51,
"executablesCount": 21,
"librariesCount": 2,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": true
}
]
}

@bobbrow
Copy link
Member

bobbrow commented Apr 4, 2022

Thank you for reporting this. As I mentioned in the PR, we'll need to get the vscode-cpptools module and cpptools to support this before we can start sending it over. In the meantime, we could downgrade the standard level to c++20 when we encounter c++23 if this is currently blocking you.

@bobbrow bobbrow added this to the On Deck milestone Apr 4, 2022
@sweemer
Copy link
Contributor Author

sweemer commented Apr 5, 2022

Thanks, this isn't blocking anything major for me at the moment.

But I'm curious - as I asked on the merge request, how does the cpptools or cmake extension know which version of Visual Studio is installed on the user's machine? As far as I understand, the value of /std:c++latest is different depending on which version is installed, so is it desirable to hardcode the mapping in src/cpptools.ts? Is there a way to dynamically resolve the standard number from /std:c++latest based on the version of Visual Studio installed?

@bobbrow
Copy link
Member

bobbrow commented Apr 6, 2022

From CMake Tools' perspective, we just tell cpptools what CMake told us. If a specific standard is requested, we send it, but otherwise we don't have to send it. cpptools owns the mappings, so we shouldn't do anything in cpptools.ts for this. Currently cpptools maps c++latest to c++20, but will be updated to use c++23 when they pick up the changes in the API. There is currently no mapping based on the version of the compiler sent. If that's something you'd like to see, I recommend opening a bug report for cpptools.

@Zingam
Copy link
Contributor

Zingam commented Apr 23, 2022

I plan to switch to C++ 23 soon. Is this just an annoyance or a blocker?

Does this fix it:
microsoft/vscode-cpptools#9177
microsoft/vscode-cpptools#7506

@bobbrow
Copy link
Member

bobbrow commented Apr 26, 2022

I believe you will need 1.10.0 of cpptools (pre-release) which came out late last week. I think we already addressed the warnings in the CMake Tools pre-release (community contribution: #2476) but it requires the matching changes in cpptools.

@bobbrow bobbrow added this to Triage in 1.11 via automation Apr 26, 2022
@bobbrow bobbrow modified the milestones: On Deck, 1.11.0 Apr 26, 2022
@bobbrow bobbrow added the fixed (release pending) fixed in pre-release and is pending official release label Apr 26, 2022
@bobbrow
Copy link
Member

bobbrow commented Apr 26, 2022

It looks like our bookkeeping didn't mark this issue as fixed yet.

@bobbrow bobbrow closed this as completed Apr 26, 2022
1.11 automation moved this from Triage to Done Apr 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product Feature: cpptools integration fixed (release pending) fixed in pre-release and is pending official release
Projects
No open projects
1.11
Done
Development

No branches or pull requests

3 participants