This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Work around MSVC's non-Standard ABI for enums.
ClosedPublic

Authored by STL_MSFT on Jul 5 2016, 1:57 PM.

Details

Summary

Work around MSVC's non-Standard ABI for enums.

So this is definitely an MSVC bug, but one that's baked into our layout behavior, so even Clang has to enable it unconditionally when targeting Windows.

In underlying_type.pass.cpp, I'm simply marking the affected static_asserts as libcxx-specific (this probably won't be sufficient when you try to get the Clang/LLVM/libcxx stack running on Windows). In make_signed.pass.cpp and make_unsigned.pass.cpp, I'm giving the enum an explicitly specified underlying type, so the tests below can remain unaffected.

If there's a better way to do this, please let me know. I could give underlying_type.pass.cpp an explicitly specified underlying type, but I'm unsure as to how your C++03 tests work.

Diff Detail

Event Timeline

STL_MSFT updated this revision to Diff 62788.Jul 5 2016, 1:57 PM
STL_MSFT retitled this revision from to [libcxx] [test] Work around MSVC's non-Standard ABI for enums..
STL_MSFT updated this object.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
EricWF accepted this revision.Jul 24 2016, 5:04 PM
EricWF edited edge metadata.

in underlying_type.pass.cpp, I'm simply marking the affected static_asserts as libcxx-specific (this probably won't be sufficient when you try to get the Clang/LLVM/libcxx stack running on Windows). In make_signed.pass.cpp and make_unsigned.pass.cpp, I'm giving the enum an explicitly specified underlying type, so the tests below can remain unaffected.

I think it would be better to check if we are on Windows, and test for the respected result accordingly.

This revision is now accepted and ready to land.Jul 24 2016, 5:04 PM

I'll check in this fix with the suggested change.

EricWF closed this revision.Jul 24 2016, 5:10 PM

r276589.