Context
The system-header verification findings of 22 Aug 2026 separated SYSTEM-mode "file not found" errors into two independent causes:
The problem (F3 in the findings)
When parsing C++ in SYSTEM mode, Clang picks the newest installed GCC (gcc-N) and requires the matching libstdc++-N-dev headers. It does not fall back to an older, fully-installed GCC toolchain. So a machine with gcc-13 + a complete gcc-12/g++-12 fails on <string> after removing only libstdc++-13-dev, even though c++/12 headers are present and working.
This reproduces exactly (Ubuntu 24.04, clang 18): force-remove libstdc++-13-dev → 'string' file not found; reinstalling that single package fixes it immediately.
Historically these breakages were misdiagnosed: F2 shows installing libstdc++ packages can never repair a stddef.h failure — that was category A all along. Past fixes worked by accident or fixed only one of the two simultaneous errors.
What Clava should do
Per the findings' recommendations, Clava should diagnose, never paper over:
- Separate the categories before parsing starts, with two cheap probes:
- Reject unsupported combinations clearly: a libstdc++ newer than the supported/tested range should produce a single "unsupported combination" error instead of cascading parse errors.
- Consider surfacing the probe result in
AUTO mode: today the libc probe runs the dumper bare, so on hosts where category B is present it just silently falls back to bundled includes — reasonable, but the user never learns why their explicit SYSTEM-mode parse fails.
References
Relevant existing machinery in this repo: ClangResources.detectLibC / LibcMode probing, and findSystemClangResourceDir.
Context
The system-header verification findings of 22 Aug 2026 separated SYSTEM-mode "file not found" errors into two independent causes:
-resource-dir=. No Clava changes needed.The problem (F3 in the findings)
When parsing C++ in SYSTEM mode, Clang picks the newest installed GCC (
gcc-N) and requires the matchinglibstdc++-N-devheaders. It does not fall back to an older, fully-installed GCC toolchain. So a machine withgcc-13+ a completegcc-12/g++-12fails on<string>after removing onlylibstdc++-13-dev, even though c++/12 headers are present and working.This reproduces exactly (Ubuntu 24.04, clang 18): force-remove
libstdc++-13-dev→'string' file not found; reinstalling that single package fixes it immediately.Historically these breakages were misdiagnosed: F2 shows installing libstdc++ packages can never repair a
stddef.hfailure — that was category A all along. Past fixes worked by accident or fixed only one of the two simultaneous errors.What Clava should do
Per the findings' recommendations, Clava should diagnose, never paper over:
stddef.h) failing → artifact problem (now covered by dumper PR Invocation of base class' constructor doubled in initialisation list #26's own diagnostics).<string>→ user environment; the error should name the exact missing package (e.g.libstdc++-13-dev), not dump dozens of parse errors.AUTOmode: today the libc probe runs the dumper bare, so on hosts where category B is present it just silently falls back to bundled includes — reasonable, but the user never learns why their explicit SYSTEM-mode parse fails.References
Relevant existing machinery in this repo:
ClangResources.detectLibC/LibcModeprobing, andfindSystemClangResourceDir.