Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ runtime tests fail for C++17 using MSVC v142 #596

Closed
mikir opened this issue Apr 17, 2024 · 0 comments
Closed

C++ runtime tests fail for C++17 using MSVC v142 #596

mikir opened this issue Apr 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working c++ C++ language generator
Milestone

Comments

@mikir
Copy link
Contributor

mikir commented Apr 17, 2024

Zserio version and language
Zserio: 2.13
Language: C++17, MSVC v142

Describe the bug
If C++17 is used for MSVC v142, the C++ runtime tests fail with the following error:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\include\xstring(2356,49): error C2338:
basic_string<T, Traits, Allocator> requires that Allocator's value_type match T
(See N4659 26.2.1 [container.requirements.general]/16 allocator_type)
Either fix the allocator value_type or define _ENFORCE_MATCHING_ALLOCATORS=0 to suppress this diagnostic.
(compiling source file D:\a\zserio\zserio\compiler\extensions\cpp\runtime\test\zserio\AllocatorPropagatingCopyTest.cpp) 
[D:\a\zserio\zserio\build\runtime_libs\cpp\windows64-msvc\release\runtime_test\ZserioCppRuntimeTest.vcxproj]

How to reproduce
Steps to reproduce the behavior:

  • Install MSVC v142
  • Set envinroment variable CMAKE_EXTRA_ARGS to -DCMAKE_CXX_STANDARD=17
  • Run scripts/build.sh cpp_rt-windows64-msvc

Expected behavior
No failure, everything should work as usually.

Additional context
Both debug and release configuration fail. There are many warnings as well:

warning C4996: 'std::allocator<T>::pointer': warning STL4010: Various members of std::allocator are deprecated in C++17.
Use std::allocator_traits instead of accessing these members directly.
You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

Please, don't forget to update GitHub actions as well!

@mikir mikir added bug Something isn't working c++ C++ language generator labels Apr 17, 2024
@mikir mikir modified the milestones: Priority Backlog, 2.14, 2.15 Apr 17, 2024
@mikir mikir self-assigned this Apr 25, 2024
@mikir mikir modified the milestones: 2.15, 2.14 Apr 25, 2024
@mikir mikir closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c++ C++ language generator
Projects
None yet
Development

No branches or pull requests

1 participant