Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1678

std::aligned_storage build failure with extra alignment

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.0
    • Affects Version/s: 3.4.0
    • Component/s: BSON
    • Environment:
      Windows \ Microsoft Visual Studio 2015 v15.8+

      Visual Studio (v15.8+) project 'bsoncxx' (and 'bsoncxx_testing') generated by CMake has compile error in 'core.cpp' (static assert in 'type_traits'):

      C2338
      You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member type would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility (*only* for uses of aligned_storage with extended alignments). Please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to acknowledge that you understand this message and that you actually want a type with an extended alignment, or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to silence this message and get the old non-conformant behavior.
      bsoncxx
      c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.15.26726\include\type_traits
      1271 
      

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            Azriel Zolotov Pavel
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: