Version of Boost
1.79.0
Steps necessary to reproduce the problem
#include <boost/json/parse.hpp>
#include <boost/json/value.hpp>
int main(int argc, char* argv[]) {
std::string raw = R"([
"123", // 456
])";
boost::json::parse_options opt {};
opt.allow_comments = true;
opt.allow_trailing_commas = true;
boost::json::value val = boost::json::parse(raw, {}, opt);
return 0;
}
compile :
g++ -I /data/vendor/boost-1.79/include -L /data/vendor/boost-1.79/lib test.cpp -lboost_json -lboost_system -o test_json
run the program, and it will terminate with the following:
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>'
what(): syntax error [boost.json:1 at ./boost/json/basic_parser_impl.hpp:634 in function 'parse_value']
either remove the comment ("// 456") or the trailing commas, the exception will go away.
All relevant compiler information
gcc/g++ 7.3.1
Version of Boost
1.79.0
Steps necessary to reproduce the problem
compile :
run the program, and it will terminate with the following:
either remove the comment ("// 456") or the trailing commas, the exception will go away.
All relevant compiler information
gcc/g++ 7.3.1