[clang] Clang should have an option/mode to better recover from fatal parser errors
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Motivated by https://github.com/clangd/clangd/issues/2229 and https://github.com/clangd/clangd/issues/1953
Basically, one example is when Clang encounters missing include it stops properly parsing after that. For regular Clang this results in missing errors that'd be still useful for the developer, e.g.: https://godbolt.org/z/Tj6foq8da
For clangd it results in bogus/hard to understand errors like in the first issue or worse.
In reality, many such "fatal errors" should be easy to recover (i.e. report missing include and treat as if there was none or it was empty).
I'm sure there are other examples but this is the most prominent one (coupled with the fact that `--include` option exist and can sneak in even if it's not required for correct compilation).
Contributor guide
Assessment
This issue has not been assessed yet.