-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Default cppbuild task doesn't have C/C++ standard flag #7268
Comments
What is your tasks.json? The tasks.json is where the build flags are set. The compilerArgs in c_cpp_properties.json are separate and only used for IntelliSense. |
I don't have a |
Okay, I see, you're using the Run: Build Task (without an existing tasks.json). Normally, I use F5, Build and Debug Active File, or Configure Default Build Task, which generates the tasks.json. The scenario you're hitting where it uses the compilerArgs from c_cpp_properties.json seems like a corner case that I wasn't even aware of, and it doesn't seem like the scenario was fully developed (i.e. the cppStandard not being used). Adding a |
Unfortunately I'm using Clang, and it doesn't like the I can workaround this with a |
Ah, I see, I've filed bug #7269 . Another (more complicated) alternative is to switch Makefile or CMake to build and set Makefile/CMake Tools as the configurationProvider, in which case the build and IntelliSense configurations will be shared. We have a related issue tracking propogating c_cpp_properties.json settings to tasks.json #6080 . |
Ok, just to make sure we understand the action item for this issue, this is what we're planning to do:
|
Yes that is what I want to see. |
The issue blocking usage of -std=c++17 is fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.4.0-insiders |
I think the way to go here is to add a feature to tasks that allows us to pull all the information from c_cpp_properties.json (or the current configuration) so that people don't have to add it in both places. We have a request tracking this here: #1285. I will dupe this issue to that one. |
VS Code version: 1.54.3
Extension version: 1.3.0-insiders2
I don't really know where to put this, please tell me if this issue should be moved.
The default
cppbuild
task doesn't add a C/C++ standard flag when an explicit standard is set in the compiler configurations. It should be added automatically to prevent confusion.Build output:
(Notice there's no
-std=...
flag)My compiler configuration:
(
cStandard
andcppStandard
are set explicitly)The text was updated successfully, but these errors were encountered: