microsoft / microsoft/vscode-cpptools
Intellisense crash - Catch `REQUIRE` macro and a `vector<string>`
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
La riproduzione minima si trova in test/src/test.cpp; eseguila prima con la configurazione Windows clang e C++20 indicata e conferma che si verifichi il crash di IntelliSense con il vector temporaneo a più elementi. Il lavoro è completato quando IntelliSense rimane disponibile, il codice continua a compilare e la riproduzione non provoca più arresti anomali ripetuti del server.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cmake, cpp, vscode
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100