<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98878>98878</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
False positive of -Wunused-local-typedef in dependent code.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hokein
</td>
</tr>
</table>
<pre>
Given the following code:
```
#define TYPE_OR_NONTYPE typename
template<TYPE_OR_NONTYPE T>
struct BaseT {
static int ff();
void Foo();
};
template<TYPE_OR_NONTYPE T>
struct DerivedT : BaseT<T> {
void Inner();
};
template<TYPE_OR_NONTYPE T>
void DerivedT<T>::Inner() {
using K = BaseT<T>;
this->K::Foo();
}
```
clang emits a unused typedef warning.
```
⇒ ./bin/clang -Xclang -fsyntax-only -Wunused-local-typedef --std=c++20 /tmp/t2.cpp
/tmp/t2.cpp:15:9: warning: unused type alias 'K' [-Wunused-local-typedef]
15 | using K = BaseT<T>;
|
```
This is shown in https://github.com/abseil/abseil-cpp/pull/1711.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVFFvszYU_TWXlysQ2BDIAw9JE6apUjtNkbY9VQZfgjfHRtiky7-fgKRNq67SJ30Ssi_29T3nnmNZOKeOhqiEbAvZLhCj7-xQdvYfUiaorbyUv6gzGfQdYWu1tq_KHLGxkoBvIN5BfBtX8fVbfhmX1CpDePjrt_3L8-8vT89PU4joLz0ZcaIl0dOp18IT8IfPmQfg-yXJ-WFsPG6FowNCvl1WEZ0XXjWojMe2BVYAWwN_2z1bJbGy9tMG5Lv3-Ic57GhQZ5IHBL5ZCE2ngO_vec3IvxpDw8_BnuvdkK94k_58cwdyT2B0k02PCHz3gSTwLd5yfKdcCHz_uFS6Fwrf2X5p7jw2Wpgj0kl5hwJHMzqSs7mSWnwVg1HmGH13RfYMihzWDDECVtXKAKuWouGfy4xh6y7Gi39Da_QFwz8WlFDbRujwhoVh6LwEvmuAbYFtWYzAKn_qp5FFTd_f7uTHRb5JMuCb9eTkle8U3nWCQivhEFj-CCxHyLZfU4Bsd1MVkwwhf8BvPXhLRlySPwmE97IdOuVQOXSdfTWoDHbe924yjVXAqqPy3VhHjT0Bq0TtSOm3IJzaZFU_6mktyZPkakggSy7XfC0CKpOcJTEv4tUq6MqkbtK6yFqZ5askSdOUrRhfpWnechE3bRaoksUsjfMkS-I4T1dRzpO0kDKRa5kVQtSQxnQSSkdan0-RHY6Bcm6kcl0UeRFoUZN283PD2Gwy8E07WOPJSGBseoSGcjoa1uPRQRpr5bx7L-aV11RWQjvC3jrl1ZnQtv93N5RBST0ZScbPz1YUjIMuv5FwQrpOYT_Yv6nxwKq5BwesWto4l-y_AAAA__8SV4NA">