<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVEuP2yAQ_jX2BdkydhxvDj5sEnXVw0pVt-qqRwwTm4qFCHB2t7--A46d7EO9NHJgmIFvHt9AZ8Rr-1WTXVJu47cjTvYaBJHaQw_WEWaBWDhacICqYCD-2SRl4wg3T0cFT6jPyY9B4l7lDGHHo5LgiDczVif9QYISLk-KfVLc3r43RCTjUGMOxGgIBsIZehrAwsFgCM6HkZETUyPEIAaMi-keSEaDryInZ3QX0KXul90IGre4kQ-oXLy6wYw4Ha0RIw_gz8zGg05qXGMMmJMZfQCYXAVhrgXrFEwO5rym8f7h544wLcjdbkd60GCZhxguN9YC97MbRzAzNKATJ_3IvDQ6MMAV-iLCYA218W-wk3Vx_uJy2kmrvMjPmsx5kVR7PvFZFiR7ZErhCC_eMpyPIJj2kqPIjT4hw-gVF3NRMtQ6j1uyi_k6AuftiCl4cP6sbraTQPB3aR5yIkl1S2hSbed9-4scx7DriUnM-SYpN5-gBSfEL6eCKim_4EdCjQP8wthutVpXQWMw5oMyz3iKsKUTIv2YYjYR7wc29ZfR6pUMBlUTkeRgzdPcUB-8IqHR6eIk9OFVFeNhvBmYGI4BI1yTqSR8YBYP02BAGZvJnbtzPkUvZ7IoJ_U2e1zyqfcf4on0h4i0WQpxbmZxVcU8ULG_oiJoLfjR6mAMlToDfo9KhwW4cPZZ353HentnRGeUD8GVN4P3R4fhTGD9ZMqN7XH1B__ivjm5l2-_uoXtVLSV2FQblrLRD8a2D5wpcC4drWrfwUk_jF2ODwUulDrNU4YJ_8ZLhUvpHFKIQl2VdZUObUXrctVUrOYbRjdd1xU3lK5XHRUl7ygcUsU6UK7FRJKy1IB8BgiUMaH0_yOQbVmUZUFpQ5t6XdG8XnPaFBWDVVPXvBHJqgC8ASoPOKFSqW0jZDf2Do1KOu8uxqmfAWLAGKGXXkH777u7vCOxQ7DhCc3C6_r2mb-8iSDwmePMQRqTaWMmfwHUT-0G>53253</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            -Wbitfield-constant-conversion does not warn on 1-bit signed integer bitfield edge case
        </td>
    </tr>

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

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

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

<pre>
    In C++, signed integers are represented in two's complement. This also applies to signed bitfields.
A signed bitfield composed of one bit can therefore store a value in the range -1 to 0. 
Assigning a value of 1 to such a bitfield should produce a warning since it is out of range of representable values.

MSVC and GCC generate the correct warnings for this situation, clang does not.

```
clang 13.0.0
-std=c++20 -Wall -Wextra -Wpedantic -Wconversion -Wbitfield-constant-conversion

struct test
{
    signed int v : 1;
};

int main()
{
    test t;
    // MSVC:  warning C4463: overflow; assigning 1 to bit-field that can only hold values from -1 to 0
    // GCC:   overflow in conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Woverflow]
    // clang: no warning produced
    t.v = 1;
    return t.v; // Returns -1
}
```

[Godbolt](https://godbolt.org/z/dM7vsxPYb)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VMlu2zAQ_RrpQkjQYknOQYfYRoMeAhRN0aJHihxLLGjSICkn6dd3SC12FtSQqeEM-d6s6jR_bb8qso-KXXj2xIpeASdCOejBWEINEANnAxZQ5Q3EPeuoaCxh-nSWcEJ9Sn4MAs9Kqwk9n6UAS5xesDrhjgIkt2mUHaLs_v69ISBpixp9JFqBNxBGkWkAA0eNLljnV0ouVI4QnBjQL6p6IEnuubKUzOjWowvVr6cRNByxIxtQubLaQY_4OhvNR-bBn6kJF61QuEcfMCY9Og8wUXlhyQXtJEwES1zT-vj0c0-o4uRhvyc9KDDUQXCXaWOAuYXGEowMDUhihRupE1r5CjCJXIRrzKHS7g12VGfzE7bTybxMs3TWJNbxqDywqZ5FRpJfVEpc4cUZiu8zcKqcYCgyrS5YYWTFzZKUBLXW4ZHkar71wDozYggOrJvVzW4SCP6uzUMuJCrvSR6Vu-Xc4SqH1Z86UYExb6Pi7hM0T0LcesurouILPsTn2MOvFdtvNnXpNRp9Pkr9jLcIXTshlB9DTKbCu4FO_aWVfCWDRtVUSHI0-rQ01AdWLGggXUl8H95kMVzGycDAcPUYfkymlLCBGrycewPK2Ex27s7lVn69kwQ5qnbJrzWe6vDBn1B-75HSayLmZuY3WUx9KQ43pfBaA240yht9pmbA70FpMQHXmn3Wd_Na7R4077R03rliOzh3tujOBNZPplSbHnd_8c8fm4t9-fa7W6sd87bkd-UdjZ1wEtr_t-E6EiFYrB3JE_-hePvFuo43cJxYRi3Eo5HtO--EG8Yuxe8ObqS8LK8E8_cHZxS3wlrsCBSqsqjKeGizssih7qotzytWQM0bltGi3EBRA-vqbSxpB9K2mJeoKBRge3gIlDE_sWiLrCiyPG_ypqrLPK1qljdZSWHTVBVreLTJAMdBpt4Pn7bYtMGlbuwtGqWwzl6NU3MDBDrEp6MbtGmfGJVgbRyo2-D6P4UF16I">