[CXX-1678] std::aligned_storage build failure with extra alignment Created: 29/Oct/18 Updated: 28/Oct/23 Resolved: 27/Nov/18 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | BSON |
| Affects Version/s: | 3.4.0 |
| Fix Version/s: | 3.5.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Zolotov Pavel | Assignee: | Kevin Albertson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | C++11, VisualStudio, build-failure | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows \ Microsoft Visual Studio 2015 v15.8+ |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Visual Studio (v15.8+) project 'bsoncxx' (and 'bsoncxx_testing') generated by CMake has compile error in 'core.cpp' (static assert in 'type_traits'):
|
| Comments |
| Comment by Zolotov Pavel [ 28/Nov/18 ] |
|
kevin.albertson, thank you! |
| Comment by Kevin Albertson [ 27/Nov/18 ] |
|
Hi Zolotov, This has been fixed on master, and should no longer require the workarounds I described above. Although it is still recommended that you configure the C driver with -DENABLE_EXTRA_ALIGNMENT=OFF regardless. |
| Comment by Githook User [ 27/Nov/18 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}Message: |
| Comment by Zolotov Pavel [ 07/Nov/18 ] |
|
thank you for the presented solution. |
| Comment by Kevin Albertson [ 06/Nov/18 ] |
|
Hi Zolotov, I was able to reproduce this on VS 2017. As the error message indicates, there is code in the C++ driver trying to create a std::aligned_storage with alignment greater than alignof(max_align_t). I'm still investigating the right solution. As a workaround, you do one of the following: 2. Define _ENABLE_EXTENDED_ALIGNED_STORAGE in the preprocessor Visual Studio project configuration. |
| Comment by A. Jesse Jiryu Davis [ 31/Oct/18 ] |
|
Thanks for the report! We aren't currently testing with Visual Studio 2017, let us know if you find a solution. |
| Comment by Zolotov Pavel [ 30/Oct/18 ] |
|
I made a mistake in 'Environment'. Correct description is 'Microsoft Visual Studio 2017 v15.8+'. |