This is an archive of the discontinued LLVM Phabricator instance.

[clang] Don't emit warn_cxx_ms_struct when MSBitfields is enabled globally
ClosedPublic

Authored by mstorsjo on Jun 13 2020, 1:22 PM.

Details

Summary

This diagnostic (which defaults to an error, added in 95833f33bda6c92e746e0b0007b69c2c30bfc693) was (as far as I can see) intended to clearly point out cases where the C++ ABI won't match the Microsoft C++ ABI, for cases when this is enabled via a pragma over a region of code.

The MSVC compatible struct layout feature can also be enabled via a compiler option (-mms-bitfields). If enabled that way, one essentially can't compile any C++ code unless also building with -Wno-incompatible-ms-struct (which GCC doesn't support, and projects developed with GCC aren't setting).

For the MinGW target, it's expected that the C++ ABI won't match the MSVC one, if this option is used for getting the struct layout to match MSVC.

Diff Detail

Event Timeline

mstorsjo created this revision.Jun 13 2020, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2020, 1:22 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mstorsjo updated this revision to Diff 270587.Jun 13 2020, 1:57 PM

Fixed the formatting

amccarth accepted this revision.Jun 15 2020, 9:29 AM
amccarth added a subscriber: amccarth.

Thanks. This seems well-contained and the test changes look good.

(rnk is on leave and unlikely to respond.)

This revision is now accepted and ready to land.Jun 15 2020, 9:29 AM
This revision was automatically updated to reflect the committed changes.