llvm / llvm/llvm-project

[clangd] auto including internal header when using `unreachable`

Open
#223,175 1 comment 0 reactions 0 assignees View on GitHub
clang-include-cleaner
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

When auto completing `unreachable`, clangd auto includes `__stddef_unreachable.h`, even if `stddef.h` is already included.

```C
#include <__stddef_unreachable.h>
#include

void foo()
{
unreachable();
}
```

Contributor guide

Open the contributing guide

Research direction

Start in clangd's auto-completion and include-insertion behavior, reproducing the example with __stddef_unreachable.h followed by stddef.h. Trace how unreachable is resolved when stddef.h is already present. Done means completion no longer adds the internal header in this case, while the existing unreachable completion still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.