microsoft / microsoft/vscode-cpptools
Intellisense crash - Catch `REQUIRE` macro and a `vector<string>`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and Version: W11 Pro 23H2
- VS Code Version: 1.95.3
- C/C++ Extension Version: 1.22.11 and current pre-release
- If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce
#include <catch2/catch_test_macros.hpp>
#include <vector>
#include <string>
TEST_CASE("bug")
{
std::vector<std::string> segs{"1", "2"};
REQUIRE(segs == std::vector<std::string>{"1", ""});
}
When I setup to build this with ninja (1.12.1) + clang (17.0.6), the parser chokes on the above code. As long as there is >1 arguments to the temporary vector constructor intellisense is dead (it compiles fine though)
This is a minimal repro - see test/src/test.cpp
Intellisense crash.zip
NOTE requires a valid $Env:VCPKG_ROOT to be defined to acquire the catch test library but otherwise should be no dependencies
Configuration and Logs
IntelliSense update scheduled and TU acquisition started for: file:///c%3A/git/bug/tests/src/test.cpp
sending compilation args for C:\git\bug\tests\src\test.cpp
<--- all the platform includes/defines --->
other: --clang
other: --clang_version=170006
other: --ms_compatibility
stdver: c++20
intelliSenseMode: windows-clang-x64
IntelliSense process crash detected: handle_update_intellisense
Shutting down IntelliSense server: C:\git\bug\tests\src\test.cpp
Update IntelliSense time (sec): 0.206
<--- repeat ^^ a number of times --->
IntelliSense update scheduled and TU acquisition started for: file:///c%3A/git/bug/tests/src/test.cpp
Failed to acquire a TU due to crash frequency: file:///c%3A/git/bug/tests/src/test.cpp
Update IntelliSense time (sec): 0.001
Other Extensions
I'm using ms-vscode.cmake-tools as the intellisense configuration provider
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The minimal reproduction is in test/src/test.cpp; first run it with the listed Windows clang and C++20 configuration and confirm the IntelliSense crash occurs with the multi-element temporary vector. Done means IntelliSense remains available while the code still compiles and the repro no longer triggers repeated server crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100