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

    <tr>
        <th>Summary</th>
        <td>
            Don't warn about deprecated fields in implicitly generated special member functions
        </td>
    </tr>

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

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

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

<pre>
    This gives a warning:
```cpp
struct A
{
 [[deprecated]] int x = 42;
};

int main()
{
    A a;
    A b = a;
 a = b;
}
```
```console
<source>:1:8: warning: 'A::x' is deprecated [-Wdeprecated-declarations]
    1 | struct A
      | ^
<source>:3:24: note: declared here
    3 |     [[deprecated]] int x = 42;
      |                        ^
<source>:1:8: warning: 'A::x' is deprecated [-Wdeprecated-declarations]
    1 | struct A
      | ^
<source>:3:24: note: declared here
    3 |     [[deprecated]] int x = 42;
      |                        ^
<source>: In function 'int main()':
<source>:8:7: note: synthesized method 'constexpr A::A()' first required here
    8 |     A a;
      |       ^
```
IMO this isn't very useful. Only the manual uses of this field should warn, not the implicit ones.

GCC has the same issue, but MSVC doesn't. I've tested on Clang 20 and trunk.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsVE2P2zYQ_TXUZbCGRNqVdNBBluN2D0EOLdozJY4kNhSp8sNZ99cXpBzbm6ZAf0AEAzRnOI_vPcyQOycnjdiQw5EcThkPfja2-cWo61Hx4XPHfdYbcW1-m6WDSV7QAYcv3GqpJ8Jakrfkp3z7DetK8tZ5GwYPKVMeSd5Cgj4KXC0O3KMghxM5nEBqD29A2An2lLBjOn-6_cnbmF241IRWhNYPMABogW_Htk2fML6GeNr1D8Angu_IGu2MwhhinTPBDkjYB8LagrC2Iqx9EgmElm0Uy9o3QkuQDh5qoryXPx77F4GD4pZ7abSLUjeeBZCygydzIH0xSA4f_k2DEdbSfbxcG49x3XBRwIwWbwAsASSg_2vy497_-L5L54cr36MDrxrGoIeoKtrxTdPS8jYh76uij-WzBnfVfkYn_0YBC_rZiAgWO9Tj22rh5nJ7h4VRWufB4l9BfqO9uot4NybP2m5Snqbi9eMn8HHApdOElh4uaK8QHI5B7eCTVlfwM8LCdeAqxh2YcasYJSoBbjZBidQchHZRWCqQy6rkID0YjW63DfbPXQczdynv-IIgnQsYq_rg4eOvv3cgDG48dvBKaHlB8OhiUxkNneJ6ApoD1wK8DfrzLhMNEzWreYZNUR6Kqt6zuszmphe82DPO87wSIw77igvGx4rWY8-KocRMNjSnh7zMy4IV9aHc1RWvir6nbBxrRmlN9jkuXKqdUpdlZ-yUJbZNsS9pzTLFe1QuvZ2UavzyVQuNT6ltYtFLHyZH9rmSzrsHjJdeYXMym93RN-C9Cf55hJK1DqS--6iuMKFGm9JuxUFyBQsuPdp7H7osWNXM3q8utg09E3qepJ9DvxvMQug5crgtL6s1f-LgCT0n5o7Q803apaH_BAAA__8ejcJ5">