Closed eitlane closed 1 year ago
Thanks for reporting this. Yes, C++23 is deprecating std::aligned_storage
, which jsoncons uses for a structure for storing string data, because std::aligned_*
suffers from many poor API design decisions. We'll be investigating a replacement for the next release.
Fixed on master.
Hello @danielaparker
Thanks a lot for the fast response. I wish everybody responds as fast as you :)
I applied the patch on my side but it still fails (much further though - 76% instead of 6%)
Here is the error:
[ 76%] Building CXX object test/CMakeFiles/unit_tests.dir/corelib/src/json_storage_tests.cpp.o
In file included from jsoncons-0.170.0/test/corelib/src/json_reader_tests.cpp:7:
jsoncons-0.170.0/test/corelib/src/freelist_allocator.hpp:20:23: error: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Werror=deprecated-declarations]
20 | typename std::aligned_storage<sizeof(T), alignof(T)>::type storage;
| ^~~~~~~~~~~~~~~
In file included from include/c++/13.0.1/bits/char_traits.h:50,
from include/c++/13.0.1/string:42,
from jsoncons-0.170.0/include/jsoncons/basic_json.hpp:11,
from jsoncons-0.170.0/include/jsoncons/json.hpp:10,
from jsoncons-0.170.0/test/corelib/src/json_reader_tests.cpp:4:
include/c++/13.0.1/type_traits:2099:5: note: declared here
2099 | aligned_storage
| ^~~~~~~~~~~~~~~
Am I doing something wrong ?
Thanks, V
You're right, I fixed the one in the jsoncons library, but there were a couple of additional ones in the test code, and one in the third party catch.hpp header. I updated to the latest catch.hpp, which fixed its issue, and fixed the rest. Fixes are on master.
After applying the patches the build is green. :) Thanks for the reactive support V
Hi all,
Compiling jsoncons 0.170.0 with gcc 13 (x86_64, linux, build from 12 March commit: f23dc726875c26f2c38dfded453aa9beba0b9be9) build fails with multiple errors like:
Once I removed -Werror from the cmake file, the project compiled successfully.
Thanks V