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

    <tr>
        <th>Summary</th>
        <td>
            unsuppressable error about invalid bitwise operation between different enumeration types
        </td>
    </tr>

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

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

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

<pre>
    We use Infiniband API installed on hundreds of servers in our farm.  It is in /usr/include/infiniband/verbs.h.  For R&D, it is third-party software.
This program
`#include <infiniband/verbs.h>`
Then compilation fails like this
```
/grid/common/test/llvm-v18.1.1d1rh74_lnx86/bin/clang++ -c -std=c++26 -Wno-error -Wno-enum-conversion -Wno-deprecated-anon-enum-enum-conversion enum.cpp
In file included from enum.cpp:1:
/usr/include/infiniband/verbs.h:550:53: error: invalid bitwise operation between different enumeration types ('(unnamed enum at /usr/include/infiniband/verbs.h:539:1)' and 'ibv_create_cq_wc_flags')
 550 |         IBV_CREATE_CQ_SUP_WC_FLAGS = IBV_WC_STANDARD_FLAGS |
      | ~~~~~~~~~~~~~~~~~~~~~ ^
  551 | IBV_WC_EX_WITH_COMPLETION_TIMESTAMP |
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
With -std=++2b, it does not.
The error is correct. What is incorrect is that the error has no ID and cannot be suppressed in any known way.
According to this page
https://clang.llvm.org/docs/DiagnosticsReference.html#wanon-enum-enum-conversion
I can make the second enum anon, too, by adding -Dibv_create_cq_wc_flags= to the command line.  The error changes but stays an error:
```
/usr/include/infiniband/verbs.h:550:53: error: invalid bitwise operation between different enumeration types ('(unnamed enum at /usr/include/infiniband/verbs.h:539:1)' and
      '(unnamed enum at /usr/include/infiniband/verbs.h:524:1)')
```
This is a wrong general situation, every message must have an ID and be suppressable.
This is some info about the header:
-rw-r--r-- 1 root root 92862 Mar 22  2021 /usr/include/infiniband/verbs.h
a07809625d1024f1dfdf3db62a66ce88 /usr/include/infiniband/verbs.h
I am unsure if copying a couple of lines from that header to this ticket is a good idea.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVk1v4zYT_jX0ZWBBoix_HHxw7Ph9DWx20yRtehMociRxI5EqSdn1pb-9ICXbzWIXSLG3EoYtk6OH8_E8QzJrZaUQ1yS7I9luwnpXa7P-yvhbzyidFFqc168IvUU4qFIqWTAlYPN4AKmsY02DArSCulfCoLCgS7BojmgsSAW6N1Ay00YABwcyzBG6760hdC8Vb3qB4emCTOj-iKawUR0B7LWBJ0LnO0K3IMP7rpZGTDtm3BmsLt2JGYxIvCPx5qWWFjqjK8PaYYbMY0LTcRsg6fZ7-5D03tuNEKiA67aTDXNSKyiZbCw08g39zvYGO3yGv3RfGekRuW5brQjdO7SO0H3THNvpMVlGSZSIxNSLWd6oP5dzQveF9Ha8Yaoi9I7QO5hymFonSLrjwwydw_RV6Skao834qPp2yrXy6fXuhUmBnUHOHIopU1oNRt9a-v8R77rB5YOCUjYIY2oElEa3N5t0k5B0c43uI9Ui6SbLYv-dknQDwWf_INWRNVJAId1JWgTdoRlSW6A7ISoQsizRoHJh_8uqO3dogdAloQtCl71SrEURTIC5j3Io-LMK8dAVoQvw3CV0IYtjzg0yhzn_Iz_xvGxYZcNWqyFsyLIYyGILl3G4-y3fPt1vXu7z7S_586-P-es233_a_O8ZSLoLy6_b_Pll83m3edpdVhbbES4Mj_fX9waQ7P5imGVJMBwR73_PXw8v_8-3Xx4eP92_HL58zl8OD_fPL5uHxw_jvx_DK8lQJKhQ-aSjiL7L7lfp6gsxR14WoxyFRgtKu6v-cISUFrg2BrmL4LVmo_DHqUHFzIG72tfM48BhF-rDmVLaQYFg-64zaC0K3zeYOsOb0icFJ3Ye99xwro2QqgKng0KhYxUOa7VznfU8pvuL1CKvyEibitC90NwSut9JViltneT2CQMROUa1axtC09MP9TTKyPsKLQvdAcEi1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