<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE2PmzAQ_TVwGQXxsUngwGG30Uo9t1LVU2WbwUzX2JFtkmZ_fQdIs7ttVbUqAmwPM2_ejB-Wrru0yS5Xx6NyHvVEHRqyGDZHjz36zYij5IEsRRKGntGzNxy96yaFAQRI0UFP3zYUoXceOBy1iGQ1KGdD9JOKbI6DiBAwwooHZNmE5EEygaR8B5jpLMkPSX7P-Nd7Wa4Q8OgcQLJ_WI3AF1uSsk7KBpLqwHl7MZmYVL94kI2r0_3rkP0DjF-k8EtwxWFsOlwJ3AA4dPW6wc5Ot_lbouv744AQJq0xRLw15uwm04HHs6eIXDhx4wIT-i3On5nPvVoplXV1reSF-Vuk80BqAE5G9sR712WviX5AhCHG48KjfORbu046EzPnNa-e-fl8koU72eBfB7630AsVZyJcWucw2KTcz7uL42wZxRMLI6ANuCiC9xn8ZLhuBx0JbV249kAJnrEuhDEZfBrIXO2juIDERT8sR899nEUW4sXgNasSa072QhHIXEANwmr2PFMc3BTnrVs0OgtRgMXzGzm6E3rjRJelXVt1TdWIVEwc6NvQq40eNkETBlRPmE7etD_1iVNMMlNu5IUxpx8D_zLuK86deaQQJgw82ZZ1UadD2-z3za7ZKpHXeY1SCNX0uwpVXWBd1U2fGiHRhDbZPiRlqQwXs4k0_xplsj2k_0-B2jIvi6Kcn2J_V2RiJ2Vf9aLI73ZNU3TJXY6jIJPNOLMGUt8ukHLSgT8aCjG8fBQhkLaIC2NmGCkabP_lGGFV_9XZkS6VtEsZ3wEfE3mz>52818</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            cppcoreguidelines-prefer-member-initializer: bad fix-it for delegating constructor
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sfc-gh-sgiesecke
      </td>
    </tr>
</table>

<pre>
    `cppcoreguidelines-prefer-member-initializer` produces a bad fix-it for delegating constructor that set member in their body, e.g.
```
struct Foo  {
    Foo() = default;
    Foo(int) : Foo() { m_bar = 3; }

    int m_bar;
};
```

The suggested fix-it would rewrite this as:
```
    Foo(int) : Foo(), m_bar(3) {}
```
which is invalid.

See https://godbolt.org/z/Yvb1ovnsr

In fact, it doesn't seem it makes sense for the rule to diagnose this case at all. While this may be considered bad style, it can't be easily changed without introducing a new constructor overload.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU9uO0zAQ_RrnZdQocXab9iEPu1Qr8QwS4gn5MnHMOnZlOy3dr2eSlLILCEGUiz2ey5kzJzLoS8e2lToeVYhoJqvRWY9pc4zYY9yMOEr6WG-zFc6-YCRvOMagJ4UJBEihobffNjZDHyJQOBqRrTeggk85TiqTOQ8iQ8IMaz6wnkxoI0gCwPg7wNKUrDqw6oHyX-9lu6aApxAAWPu4GoEusjC-Y3wPrDlQ3V5MLrPmNw_r8-r08DqkfYTxixRxCW4ojEyHK4BbAgpdvW5pZ6fb-i3Q9f1xQEiTMZgy3og5h8lpiHiONiM1bom4RID-mOfvyGeuVkh811w7-Yn8babzYNUAVMz6E81Ol6-BfkCEIefjgoM_0W2ClsHlMkRDuxd6Pp9kHU4-xdeB7z30QuUZCLWmAybPeDtPF8fZMopnEkZCn3BRBM0Z4uSo7wDaCuNDunKgBK1IF8K5Ej4N1l3to7iAxEU_JMdIPM4iS_ni8FpVibUmeaFI1l1ADcIb8jzbPIQpz6NbNDoLUYDH8xs5hhNGF4QuC901et_sRZFtdtj9z39AY_kn8RdTdN0vVBPKSZYqjLRx7vTjQ9XCV5zJfbIpTZhocc939a4YuoqrXVvV-6bdtRpFhZqrZivbuq63oto1hRMSXerY_SPjXDniY5Pt_Hdxdn8obMcrXtd8fur2ri7FVsq-6UVd3W33-1qzuwpHYV05A5lFUMRuwSQnk-jQ2ZTTz0ORkjUecalH-cVExMcu9Wpjhk0yFhOqZyyWPrqlie9X8WN-">