Skip to content

Unable to switch off diagnostics for "Invalid bitwise operation between different enumeration types" #144291

Closed as not planned
@DominikDeak

Description

@DominikDeak

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

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 #92340, but not sure what the outcome was for this.

If there is a work-around to disable the aforementioned enum diagnostics for third-party or system headers included in C++26 projects, that would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions