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

    <tr>
        <th>Summary</th>
        <td>
            `sizeof` boolean vector using `__attribute__((ext_vector_type(4)))` evaluates to zero.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    The documentation on the boolean vector extension [currently says](https://clang.llvm.org/docs/LanguageExtensions.html#boolean-vectors):
> Clang also supports the `ext_vector_type` attribute with boolean element types in C and C++. For example:
> ```c++
> typedef bool bool4 __attribute__((ext_vector_type(4)));
> // Objects of bool4 type hold 8 bits, sizeof(bool4) == 1
> ```

Yet this program doesn't compile ([godbolt](https://godbolt.org/z/h19GEYsar)):
```c++
typedef bool bool4 __attribute__((ext_vector_type(4)));
// Objects of bool4 type hold 8 bits, sizeof(bool4) == 1

static_assert(sizeof(bool4) == 1);
```
with this error
```
<source>:4:1: error: static assertion failed due to requirement 'sizeof(bool __attribute__((ext_vector_type(4)))) == 1'
static_assert(sizeof(bool4) == 1);
^ ~~~~~~~~~~~~~~~~~~
<source>:4:29: note: expression evaluates to '0 == 1'
static_assert(sizeof(bool4) == 1);
 ~~~~~~~~~~~~~~^~~~
1 error generated.
Compiler returned: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVUuPqzYU_jWHzdFExuaVBYs820Wlbrq5q8jAAVw5mNpmmplFf3tlYObepNNKo06EHAmfx_d954F0TnUDUQnpHtJjJCffG1v-TEKr2-0WVaZ5KX_rCRtTT1cavPTKDGgG9D1hZYwmOeAz1d5YpJunwYV7SPf1ZC0NXr-gky8O0iPwovd-dCB2wM_Az7WWQ7fR-vm6MbYDfm5M7YCff5FDN8mOTm_h3Kb3Vw1crPmelnwO-DYEY0dgOxAnPISAKLUz6KZxNNa7GSZkjG7-snhd_MtIkDGU3ltVTZ7wT-X7dy6kKfDEYOZQDXhAOTR4AL4Hvt_geSYqr6Omu-SQseWpF8vvNyFSQ-2cYT4SvFzes18uwAvgxSNCXiSB3_KIH8It4uGv1e9Ue4emXWMGL-yNbrDASnkH_IBOvZJpgRezCfAtgjiCOGL8AfD11Xx-I4--Vw5Hazorr9gYcgPw3GNtrqPShAF2uu9MUxntP6rverUW9xX4uY-3P52-OWnfaL3p96F2X6nbV2o2ny5MQn2RzpH1wIv_8PoRx73Wc-PNMpO1xn5oA-LgzGRrAnECsUtA7GIQu9VD7HBBgguSMHytVJoabCZCb9DSH5OyS08Dz-9wflrPO1r5_1IiPeFf__j9K-W5WXAwnmbut9GSmzcNPUs9SU8ucAWes68C-IAO0tM7vngRHzsayEpPzWZ5f1gmw6IlP9mBmoA1fqhq1JSi2YqtjKiMs5znGRdpEvVlnWdpWmWFbJMkKVqWJm0Vt0WdFyRl0baRKjnjgsVMxFnMRbKJKctj1sT5luWxyLaQMLpKpd93aqScm6hMtwWLIy0r0u5t0dsyGD1VU-cgYVo57767eeU1lZCxVaqMPa76yamhC6vjsx2UsfuSvZI1m2iyunxYHsr3U7WpzRX4OQBb_55Ga8IQAz_P5MIHY-b3dwAAAP__a7YYTA">