I have a single file on my workspace, called test.cpp. When I open it with VSCode, IntelliSense immediately blows up. I'm using VSCode 1.19.2 and C/C++ 0.14.5 running on Ubunto 14.04.
test.cpp, which compiles with g++ test.cpp -std=c++11:
#include <vector>
struct S {
int a;
};
std::vector<S> v;
int main () {
v.push_back({
.a = 0
});
return 0;
}
Extension Output:
IntelliSense Engine = Default.
Autocomplete is enabled.
Error squiggles are enabled.
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
File exclude: **/.DS_Store
File exclude: **/.vscode
Search exclude: **/node_modules
Search exclude: **/bower_components
Search exclude: **/.vscode
Code browsing service initialized
Folder: /usr/lib/gcc/x86_64-linux-gnu/4.8/include/ will be indexed
Folder: /usr/local/include/ will be indexed
Folder: /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/ will be indexed
Folder: /usr/include/ will be indexed
Folder: /home/diogoribeiro/Desktop/minimal_example/ will be indexed
Discovering files...
Checking for syntax errors: file:///home/diogoribeiro/Desktop/minimal_example/test.cpp
Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/4.8/include/
Processing folder (recursive): /usr/local/include/
Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/
Processing folder (recursive): /usr/include/
Processing folder (recursive): /home/diogoribeiro/Desktop/minimal_example/
Indexing: 3044 file(s) processed
Indexing: 0 file(s) removed from database
Done discovering files.
Parsing open files...
Checking for edits and parsing remaining files...
Processing folder (recursive): /home/diogoribeiro/Desktop/minimal_example/
Done parsing open files.
Parsing: 1 files(s) processed
Done parsing remaining files.
Failed to read response from server: 18
IntelliSense client has disconnected from the server - /home/diogoribeiro/Desktop/minimal_example/test.cpp
I can provide more information on request. Thanks!
Thanks a lot for reporting. I'm able to repro it on Linux (it doesn't repro with the msvc-x64 mode, only clang-x64). We'll try to get it fixed for the Februrary update.
The .a = 0 is the cause. It's not a syntax our parser considers valid C/C++, although it's supposed to give an error instead of fail. Using just push_back({ 0 }) instead might be an alternative.
The ".a" designated initializer list is a new C++20 feature that hasn't been implemented by our compiler yet, so we expect a later release to just fix the crash, and it'll give an error message until the feature support has been added later on.
This crash is the "copy_cached_token" crashed if anyone else is seeing it. We've reported the bug to the Edison Design Group (https://www.edg.com/ ), but we don't know when they'll get around to fix it (you could try asking them directly). We're not seeing enough users hitting this crash to increase the priority yet, but we'll continue to monitor the crash data to prioritize parser-related crashes.
The crash has been fixed with 0.17.7-Insiders, but the code will generate an error -- I assume until our compiler supports the C++20 feature (no ETA). We could create another bug for this if you want.
Thanks a lot for you work : )
This hasn't been bothering us at all. Obviously it would be nice if it could be fixed in the future, but it's not a priority unless someone else needs it.
Most helpful comment
The ".a" designated initializer list is a new C++20 feature that hasn't been implemented by our compiler yet, so we expect a later release to just fix the crash, and it'll give an error message until the feature support has been added later on.