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

    <tr>
        <th>Summary</th>
        <td>
            -Wbraced-scalar-init warns inappropriately
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Braces around the returned value serve a legitimate purpose in
```c++
char f()
{
  int i = 65537;
  return{ i };
}
```
They tell the compiler to fail because the return value is narrowed; without the braces this would compile.  Yet, `-Wbraced-scalar-init` warns that this is a superfluous use of braces.  Likewise if the return value of `f` is instead `int` the braces legitimately ask the compiler to check for narrowing, which in this case is not occurring; in this situation too, `-Wbraced-scalar-init` should not be warning that this is a superfluous use of braces.  (In practical cases, the returned value might be from a function that has a return type that is not so readily apparent and the code writer should instead be encouraged to use braces in situations where narrowing is a concern!)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU01r4zAQ_TX2ZUhw5DqJDz60GwoLPS4se5SlsaWtIhl9NOTf78h2ml1aWAoCWzOj9948jXonr92T5wIDcO-SlRAVgseYvEUJb9wkhID-DYGDwVFHfeYRYUp-cgFB26I6FdVjsa-WJQr2lNccFYp7GAp2LFi71h3WFNDRCBqK-gT7pqkPRf2eWeipNOcPp_dM_v-Xbdn-UHiFiMbM4oU7T9qgh-hg4NpAj4In0nrvbO1LB7Dce3dBSRxw0VG5FOe6fvEkKqq5uGTkDXYL8Atjwb4B0W9-znVyEwQ33G-01ZHCcOHe5sM8Lgi0OIQ0oR9McilAluOGlYUgX_QrXnT2c_gokwoJdMjAGcuGiFzmEDmYg3_pvd-QuQIPrx8MEQrFKwzOr51rO-ZeLkoLRdCLXMHDYo6L4IRI3ucycuhWEHRMPGpHW-f-40VQs30Zq8fZGQL7ijc0Pt8tTLSNmqBndSGTfjKpZz2qmWfw7ky4Q7Ji0Zn5FM9cq7fxOuESXjsNjlJc6uzcNHGPNJ98fRDCSdLudSQX14Zu90BkaIVLno8kgyzO-tfrIL_eraI5Uujx7vvSuXBWIA0729EbKWVXy7ZueRl1NNh95uk6XNqSSO8mr-fLLpM3nYpxCkX9WLBnWjQJKvVbun3aGPN2-2zo2G8UNMPPOoSUvXxuHg4VK1U3HNsdq3glaoasllI2h-ow7KoWpdgfsS8N79GErmjokTOLF5gh6L9oTqXuWMVY9VDtdnvWNs223clKYouDOIq-HrB4qPBMT3KbdWydH0vfzZL6NAZKGh1iuCd5CHq0iDMd4fNED9R3L4iWmitn6m6W_geWcJzu">