-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Designated initializers error squiggles #13532
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
Comments
@MightyJosip When you run the C/C++: Log Diagnostics command, what is the C or C++ standard version and IntelliSense mode that is reported as being used? c++17 and windows-msvc-x64? Does your compile_commands.json specify a c++20 version? If so, there may be a failure parsing it, and it using the c++17 from the base configuration. (C++20 is required for designated initializers, unless you're using C?). |
Hi, this is the output of the C/C++: Log Diagnostics C/C++: Log Diagnostics
Now I am not sure how to check the version in the compile_commands, but the specific entry in compile_commands for that file looks like this
The entire repository is written in C, it doesn't have any cpp files. However, when you mention C++, if I modify the c_cpp_properties to include the different cppStandard (20), I don't get the |
@MightyJosip Yes, there was a bug causing a .c file to be interpreted as C++ in compile commands. It'll be fixed in when 1.25.1 is released (and then we plan to push the fix to a release update some time after that). |
Cool, thanks, I will close the issue then |
@MightyJosip It should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.25.1 . Let us know if you still have the issue with that. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary: Using designated initializers raises the error saying "expected an expression C/C++(29)"
Steps to reproduce:
I will post the image as the example
If I write it like this, no error is reported
however, both codes are working
Expected behavior: No error squiggles reported, since the code is indeed able to be compiled
Configuration and Logs
Other Extensions
No response
Additional context
Extra notes: Checked older versions, in the Extension version 1.22 it didn't raise the error, however, starting from the 23, it does. Also, if it will help, the description in v24 of the following code looks like
However, on v22, it looks like this
The text was updated successfully, but these errors were encountered: