<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59916>59916</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Constructor call of a sugared type should not consider the underly type as a use
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-include-cleaner
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hokein
</td>
</tr>
</table>
<pre>
For the `Bar();` usage in main.cpp, include-cleaner considers both UsingType (`Bar`) and the underlying type (`Foo`) as uses (thus we insert both `foo.h`, and `bar.h`). In this case, we should not consider the underlying type `Foo` as a use.
```
// foo.h
namespace ns {
class Foo {};
}
// bar.h
namespace ns2 {
using Bar = ns::Foo;
}
// main.cpp
#include "bar.h"
void k() {
Bar();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEUtFupDgQ_Brz0hpk7GCGBx4yGSHd-90HGNMBXzz2yG0nyt-fwDOZ2-xqV0IgiqKq2l2ayC4ecWDtibXnSue0hjis4Q2tr6Ywfw5jiJBWBKb4SUcmjkz0TJ6Y4pBJLwjWw0VbX5vrlYkXAOuNyzMejEPtMYIJnuyMkWAKaYV_yPrl788rwqZVRBVnogft590p-xmj-7R-gfTgjSHceQSZkDY8rZngY8tAGFMxYIq_hlCvO_tlV2WKTzreoL6Gvzyk1RIYTbhxPhBoDdnN4EP6CvzrMPckWwy9BakZPzP-fLsrfrvKqxiZGKHk2RGvL0hXbRA8AetOBTVOE8EYwg515-2Ai0B3_kG-6JVhftITD8G8nTKcdAQmz-CJyWcmn7fkv1f-2uQNlLdtAhOiuApRvr0HO8Nb6cPDF_7fEYDvVvfTqeZBzr3sdYVDozopW6FkW60Ddlw-teYose-xfxW8P7a8VS22k8JWysoOggvJm4Y3ouGyrblWRh871aA0HR5n9sTxoq2rnXu_1CEulSXKOLR936jK6Qkd7XUXwjjtl8O3vm4DtucqDtv_hykvxJ64s5TooZhscji8BE8pZpNCBKOdg_AKGigvOuJc2vKHVhXSvUhQ5eiGNaXrvq59IYtNa55qEy5MjJv_7XG4xvAvmsTEuI9HTIz7hP8FAAD__y4HJE8">