https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117988
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>: https://gcc.gnu.org/g:52fe9502eb153f87154cfcb6a58ab84164d7e1d9 commit r16-416-g52fe9502eb153f87154cfcb6a58ab84164d7e1d9 Author: David Malcolm <dmalc...@redhat.com> Date: Tue May 6 09:26:19 2025 -0400 json: implement JSON pointer; use it in sarif-replay [PR117988] This patch extends our json class to track JSON pointers (RFC 6901), and then uses this within sarif-replay to provide logical locations within the JSON when reporting on issues in the SARIF. gcc/ChangeLog: PR sarif-replay/117988 * json.cc (json::pointer::token::token): New ctors. (json::pointer::token::~token): New. (json::pointer::token::operator=): New. (json::object::set): Set the value's m_pointer_token. (json::array::append): Likewise. * json.h (json::pointer::token): New struct. (json::value::get_pointer_token): New accessor. (json::value::m_pointer_token): New field. * libsarifreplay.cc (get_logical_location_kind_for_json_kind): New. (make_logical_location_from_jv): New. (sarif_replayer::report_problem): Set the logical location of the diagnostic. gcc/testsuite/ChangeLog: PR sarif-replay/117988 * sarif-replay.dg/2.1.0-invalid/3.1-not-an-object.sarif: Add expected logical location. * sarif-replay.dg/2.1.0-invalid/3.11.11-missing-arguments-for-placeholders.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.11.11-not-enough-arguments-for-placeholders.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.11.5-unescaped-braces.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.13.2-no-version.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.13.2-version-not-a-string.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.13.4-bad-runs.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.13.4-no-runs.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.13.4-non-object-in-runs.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.27.10-bad-level.sarif: Likewise. * sarif-replay.dg/2.1.0-invalid/3.33.3-index-out-of-range.sarif: Likewise. * sarif-replay.dg/2.1.0-unhandled/3.27.10-none-level.sarif: Likewise. Signed-off-by: David Malcolm <dmalc...@redhat.com>