Working around unconformant offsetof in msvc

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Working around unconformant offsetof in msvc

This post has NOT been accepted by the mailing list yet.
I'm trying to feed visual studio headers to clang 4.0.0. It seems to work but I'm still getting these errors:

c:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/include\xstring:1905:26: error: constexpr variable '_Memcpy_move_offset' must be initialized by a constant expression
        static constexpr size_t _Memcpy_move_offset = offsetof(_Mydata_t, _Bx);
                                ^                     ~~~~~~~~~~~~~~~~~~~~~~~~

Unfortunately this is C++ unconformant code (https://developercommunity.visualstudio.com/answers/23373/view.html), is there any way I can workaround this or have clang accept it anyway (perhaps -fms-compatibility should have included it?)