<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/133425>133425</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `bugprone-unintended-char-ostream-output` reported with sufficient cast
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            false-positive
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          firewave
      </td>
    </tr>
</table>

<pre>
    ```cpp
#include <cstdint>
#include <iostream>

enum E : std::uint8_t {
    E1
};

void f(E e)
{
    std::cout << static_cast<unsigned char>(e);
}
```

```
<source>:10:15: warning: 'unsigned char' passed to 'operator<<' outputs as character instead of integer. cast to 'unsigned int' to print numeric value or cast to 'char' to print as character [bugprone-unintended-char-ostream-output]
   10 |     std::cout << static_cast<unsigned char>(e);
      |               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  static_cast<unsigned int>(static_cast<unsigned char>(e))
```
https://godbolt.org/z/vzPoa9jnd

CC @HerrCai0907 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVM2O4jgQfprKxQL5h5DkkAMdQHvcNxgZuwIeBTuyy7RmDvvsKyc0M727Gs1hLWQSV9X3U6lEp-SuHrGH-g3qY6Uz3ULsRxfxXT-wugT7rYc9X39mnoEfQCrnzZQtMlCDSWSdJ1Cnf4VcSBRR358xfkCf7-zEQB1YIgvqAOqQnaf2CzFo3oAfGGPsJEp2cwT1tpY9grNsBNmeGILsluhH8gvHhEyFFNTAEmly5ovRiUAN2S8eLTM3HYsW2S4wK3xzLPuHw5Xw060aUsjRYKlUB8HLVhcL7zp656_lEmTzmUU2bNYpoWUUSjTMGDWFuAos4ZBpzpSYTkuFNoSROZ8ItWVhZM4TXjFuWXHxRHlxlIbLppzO0XliPt8xOsMeesrIQvy56EPPK_kTI9Rvl3ydY_C4yb6Qeot2UxI2z8e3WaVCfVx7LjiDZmD_R_cXkBfajwX1if31q_WL2kXWfyp4jqlsf0_hOmk_jcKNaE7FrzyDPF-DvYSJtiFeQZ6_gzw_vv8ZdPfV23WKhoHBjv-BMQ7a8Y43rLK9sp3qdIW9aHZK7LmSorr1eteMdbvfia7r2kY1Ix_3ojG6Q2Xby85Wrpdc1lzJVgghudi2So9CG9O0Yi-6_R52HO_aTdtpetyLpsqllLEXSu1kXU36glNa3nIpzaT9dUPOfgMpQQ4g5ainhJs5JEfugeW4PlaxL2CbS74m2PHJJUo_4MnRhOXT8Lvjs-cs4hwioWXvjm4s5XF0xqGnZVyrHKf-Hy12dMuXrQl3kOfC_PzbzDF8RUMgz4vLBPL8NPro5d8BAAD__03Devo">