<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109631>109631</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] False Negative: -Wsign-compare not triggered on instantiated templates
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics,
false-negative
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
carlosgalvezp
</td>
</tr>
</table>
<pre>
Example:
```cpp
#include <cstdint>
template <typename T>
struct Foo
{
static constexpr T size{123};
};
void f()
{
std::int32_t foo{123};
std::uint32_t bar{321U};
auto x = foo == bar; // OK, -Wsign-compare triggered
auto y = foo == Foo<std::uint32_t>::size; // NOK, no warnings
}
```
https://godbolt.org/z/355WMh6hz
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk81u4zgMx5-GvggJZCq244MP-agvi-1euuhxIEuKo4EiGRadafP0AznJtE0HMCSa-PNHkZRkjLb3xjRQbKHYZ3KiYxgbJUcXYi_d2VyGrAv6vXl6k6fBGRAb4Hvg97Xk108Nw82DwnrlJm0YiJ2KpK0nEE-fo8icBidpVtD7YLw8GfbyRxRpnBSxNoRbULW9GowxFkmSVUwFH8m8DSN7YdFeDFTbHAVUexDbe9Qne17PwWp2AFwD1n8l61Sd2FhPAn8QO4TwHftFOd2lnRyh2grM_3_UyokCe2Mg9omX9mQmvdgywBawZf_9A7hji9c0i4UKp0GOhtFo-96MRj-w3h9ZqU9i9-1MqZ2zY26P2DJ2T_d8zecD-yVHb30fPzr2darX3yPREBNrDu-D7oKjZRh7wPYC2IqieP33WB4vmW6ErkUtM9PkFVa8qgUvs2PDZaF4hXmt16rLO6NkWahDwWs8dKtS88w2yHHFaxR8nRe8XHai7Goh1qhqneuqhBU3J2nd0rnzKeXObIyTaXJelyLPnOyMi_MtRlRO-h7ERlvZ-xDJqgiIgDtAPEgXzcKbXpI9m-Qu9tnYJOqim_oIK-5spPiRhyy5-X1cscWetYnBnu8MsXkcnQ_0MT4WPLM-kvRkJRnN7rc_ZtPomofmWjpO3VKFE2CbjnDbFsMYfhpFgO1cdwRsb6WfG_wdAAD__7xXG4Q">