<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/144291>144291</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unable to switch off diagnostics for "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>
DominikDeak
</td>
</tr>
</table>
<pre>
I have come across an issue where certain third party header files generates the following error, when included in C++26 projects:
>/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h:96:18 Invalid bitwise operation between different enumeration types ('CGImageAlphaInfo' and 'CGImageComponentInfo')
Trying to disable diagnostics using the following pragmas does not work:
```
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wenum-conversion"
#include <Cocoa/Cocoa.h>
#pragma clang diagnostic pop
```
Sample test project for Xcode 26: [Test.zip](https://github.com/user-attachments/files/20749306/Test.zip)
I realise Apple uses their own custmised clang, but i'm speculating they pull most of core features/bugfixes from upstream `llvm-project`. I've also raised an issue with Apple, but I have not gotten a response. There is also a related issue https://github.com/llvm/llvm-project/issues/92340, but not sure what the outcome was for this.
If there is a work-around to disable specific diagnostics for third-party or system headers included in C++26 projects, that would be appreciated.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVV-v27YP_TTKCxHDkfPPD3nITZr-Ln4bNqAd1lfapm3typIh0smyTz9I8e1tO6AFNsBAAJGiDg8PT5DZdI7ooDZPanNe4CS9D4ezH4wzL2fCl0Xlm_vhGXq8EtR-IMA6eGZAB4Z5Irj1FAhqCoLGgfQmNDBikDv0hA0FaI0lho4cBRRikJ6g9db6m3EdUAg-KH2KdRwYV9upoQaMg5PST0o_6S2Mwf9BtbAqjipPX_FO6ctxHK2pUYx3rPTlU-0bWlYkmOE4Kn05eSf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