<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/130571>130571</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Add inlay hints for default arguments
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clangd
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ilya-biryukov
</td>
</tr>
</table>
<pre>
It would be great to show default arguments in various places through inlay hints.
Right now, only parameter names are shown in calls:

It would definitely be great if one could also see the default arguments from declarations on the definition and use sites (comments below mark inlay hints I'm proposing to add):
```cpp
void foo(int a = 10);
void foo(int a /* = 10*/) {
}
void test() {
foo(/*10*/)
}
```
Going a bit further, we could also consider adding inlay hints for default arguments, although they look like a harder sell to me because I expect more noise (e.g. `unique_ptr` has a default deleter, `vector` has an allocator and `unordered_map` have hash defaults that are going to be popping up everywhere):
```cpp
template <class T = int>
struct Foo {
};
Foo</*int*/> x;
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVMGO4jgQ_RpzKYEchwA55EB3D6u-rvY-qtiVxNuOK2s7MPz9ykl306sZ7UhIgPzq1fN75cIYbe-JGlE9ieplg3MaODTW3XHb2nCf3_i6adncm9cEN56dgZagD4QJEkMc-AaGOpxdAgz9PJJPEayHKwbLc4TJoaYIaQg89wNY7_AOg_Up7oQ8C3n-0_ZDAs83oZ6BvbvDhAFHShTA40gRMNDSyGdejc5FUeZKoQpRPb2O2JOoXoQ6DSlNy5m6CHXpbRrmdqd5FOoyRwpbTAn1sEgU6oIx0vJDd0fUEtttfera7b4-dNuT1t1Wd9XxRHvZ7uVJqHqV-2mDoc56m8jdH47YDtgT6AWALjJEIkgD_cKjLvAIhrTDgMmyj8D-A5qJLXtAb2COBNEmiiDUSfO4Vrfk-AYjhrevlsKrUMcRpsATR-v7HBEak8Wvjh3k-tHTJOT5ytZAxyzUyfoECKJ8gUIu8Kdfnmdjz5-w1egaxDGjx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