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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] modernize-return-braced-init-list and complex type casts
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

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

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

<pre>
    I got `modernize-return-braced-init-list` warning for next code:

```
#include <boost/python/extract.hpp>
#include <boost/python/object.hpp>

std::string test(const boost::python::object& data_set, const char* attr)
{
    const boost::python::object attribute_object = data_set.attr(attr);
    if (attribute_object.is_none())
    {
        return {};
    }
    else
 {
        return boost::python::extract<std::string>(attribute_object);
 }
}
```

```
warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]
      return boost::python::extract<std::string>(attribute_object);
```

I tried 19.1 and ~ month-old `main`. Boost version is 1.86. Sorry, was not able to reproduce in on GodBolt, because it's not obvious how to specify path to local Boost libraries.

I think will be good idea to have option to filter out such complex type casts in `modernize-return-braced-init-list`.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VE2T4jgM_TXmoiKVOCSEQw7QDFtz3tteuhxbEO8YK2UrdDOH_e1bTtIfM7Nb3ZehUmAbv6cn6UUqRnvxiK2oDqI6rtTIPYX2y3hBj3-hQ_-NVh2Ze_sVLsQg6vxKBoO333EdkMfg111QGs3aestrZyOLOocnFbz1FzhTAI_PDJoMinIv8ump8-XJ90KW1ms3GgRRPnREkYU8DXfuyQt5wmcOSnPWD4Mov3x8n7q_8Yfr-T6ySZHLfeSQNDEmSKPJR4aZYPp74ZjWM42QNRjF6jEiC_kAM0T3Kgi5B8UchNylINuDyPcAAJ8gnXC2GxkflwNRHl_DZDNr80JevjDbMyzH77GZjY-ePArZpNuTmnT7TVH6zI2aDrfHN8q0mVfoIqblf8L-J5ulM6J8-KnAqfC_Kn1LZg67fL93wo_bxUKi3IO6kTUQcEDFUwd7fBHH9wHhHOg6HRrUTgXFNok8wBgRFMz-hORPq5z9jgGSTcH6yKgMiOrwsaer42thfk9ZfqrEV-Bg0UCxywpQ3sA_cCXP_Zqcmd5CZb2o8wwOSQbcMERLHmyEImvqDP6kEO7Js08qgicG1TkEplTFQGbUCNYDefiDzIHcZO8OtUolsyzkdkZRd7M0RujpKYHjgNqe7zAo7tPekVZukeBsF1SwGLPXDHrrv8GTdQ46hAuRAWtQJWCvbgg0pEal7dk6xgA0MsRR96DpOjh8nrurVeSY1H5y-GQr05ZmV-7UCttiW8k6b5pyt-rbptpt6m7bbDe1KbUsjZRdIdW56uqq2VRqZVuZyyrfFlWx22yLXVbWTVU2Wy3zTVGiUmKT41VZlzl3u2YULisb44htsWl2G7lyqkMXp2EqpXbKX9ZszV1ImYZraBNq3Y2XKDZ5UhvfeNiym8bwO1h1hA8Tnszxa71WY3BtzzzE5EF5EvJ0sdyPXabpKuQpxV1-1kOg2YqnKZko5GnJ59bKfwMAAP__OHf4SQ">