microsoft / microsoft/vscode-cpptools
Intellisense crash - Catch `REQUIRE` macro and a `vector<string>`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Die minimale Reproduktion befindet sich in test/src/test.cpp; führe sie zunächst mit der aufgeführten Windows clang- und C++20-Konfiguration aus und bestätige, dass der IntelliSense-Absturz mit dem temporären Vektor mit mehreren Elementen auftritt. Als erledigt gilt die Aufgabe, wenn IntelliSense weiterhin verfügbar ist, der Code weiterhin kompiliert und die Reproduktion keine wiederholten Serverabstürze mehr auslöst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cmake, cpp, vscode
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100