<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/139467>139467</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
bugprone-narrowing-conversions false positive for contional expression (in C)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AndreyG
</td>
</tr>
</table>
<pre>
```c
char test(int cond, char c) {
char ret = cond > 0 ? ':' : c; // warning: narrowing conversion from 'int' to signed type 'char' is implementation-defined
return ret;
}
```
https://godbolt.org/z/6P8Yaqn4o
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcUk1v3CwQ_jXjC9oVHvzFgYOTvH6vvfaIzayXCoMLeNP011c4SSNVsow0wzPzfKBTsqsnUtA-QftS6SPfQ1SjN5He_q_mYN4UdPz9W4CPy11HlillwMH6zJbgDeAzO-sLoGTQPwEfgcuzFCkzEC_nPQbiP8YZiIkB9iBGwJ6BGNkC4okBToATe9XRW7-Wstcxhlfr14J-UEw2eHaLYStw63OB58BOBYblt51Ko6wtHZuY3XZHG_mssw3-YuhmPZl3dpHyEX3hB-Ik3L-U_6dW4OM95z2dLAuxNZg5uHwNcQWcfgNO3bfhu_7pm1AZJYwUUlek6r7ppGx6Kau7Ek3b8lrMA0eSVM-inUXTkTHz0KDUvLIKOba8rWvktWzlldfNMvRtp1tTL2booeG0aeuuzj22sruyKR2kaiGbrq-cnsmlMzzEm3aJLntINtsHAWIJNKqCvMzHmqDhzqacvmZlmx2p-Vj3GDxd_vp9-fI7sXMs-xzLbiGWOIqh2jH6tUdKZzDng2DPgLI6olP_uGfz_ZivS9gAp7L_47jsMfygJQNOp7AEOH1oeyj8EwAA__--4NC-">