Description
std::vector< json > jsons{};
jsons.emplace_back( json( { { "key", "value" } } ) );
yields error: array subscript is partly outside array bounds of 'unsigned char [32]' [-Werror=array-bounds=]
When built with JSON_DIAGNOSTICS and -O3 and -Wall
It appears to be a gcc bug fixed in 15, but I didn't know if you wanted to implement a work-around or not.
Reproduction steps
See compiler explorer here: https://godbolt.org/z/fnrzsqKeT
Expected vs. actual results
compiles
Minimal code example
Error messages
Compiler and operating system
Ubuntu 24.04, gcc 14
Library version
3.12.0 and HEAD today (568b708)
Validation
Description
std::vector< json > jsons{}; jsons.emplace_back( json( { { "key", "value" } } ) );yields
error: array subscript is partly outside array bounds of 'unsigned char [32]' [-Werror=array-bounds=]When built with
JSON_DIAGNOSTICSand-O3and-WallIt appears to be a gcc bug fixed in 15, but I didn't know if you wanted to implement a work-around or not.
Reproduction steps
See compiler explorer here: https://godbolt.org/z/fnrzsqKeT
Expected vs. actual results
compiles
Minimal code example
Error messages
Compiler and operating system
Ubuntu 24.04, gcc 14
Library version
3.12.0 and HEAD today (568b708)
Validation
developbranch is used.