{"id":2229946,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229946/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/20260428232704.1953719-1-dmalcolm@redhat.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260428232704.1953719-1-dmalcolm@redhat.com>","date":"2026-04-28T23:27:04","name":"[pushed:,r17-168] json: move pp_markup::quoted_json_pointer to its own header","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"657b4b12a82d55f62978856ef05be16517649ba5","submitter":{"id":24465,"url":"http://patchwork.ozlabs.org/api/1.1/people/24465/?format=json","name":"David Malcolm","email":"dmalcolm@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/20260428232704.1953719-1-dmalcolm@redhat.com/mbox/","series":[{"id":501955,"url":"http://patchwork.ozlabs.org/api/1.1/series/501955/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501955","date":"2026-04-28T23:27:04","name":"[pushed:,r17-168] json: move pp_markup::quoted_json_pointer to its own header","version":1,"mbox":"http://patchwork.ozlabs.org/series/501955/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229946/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229946/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=SvSrnIeW;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=SvSrnIeW","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4xTd63KFz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 09:29:09 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B99834BB8F7A\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 23:29:07 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id 195BF4BB8F69\n for <gcc-patches@gcc.gnu.org>; Tue, 28 Apr 2026 23:27:09 +0000 (GMT)","from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-USHomKE7MJW3Vz_R_1mRTQ-1; Tue,\n 28 Apr 2026 19:27:07 -0400","from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 4F56B1955F25\n for <gcc-patches@gcc.gnu.org>; Tue, 28 Apr 2026 23:27:06 +0000 (UTC)","from t14s.localdomain.com (unknown [10.22.65.168])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id C6D28195608E; Tue, 28 Apr 2026 23:27:05 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org B99834BB8F7A","OpenDKIM Filter v2.11.0 sourceware.org 195BF4BB8F69"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 195BF4BB8F69","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 195BF4BB8F69","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777418829; cv=none;\n b=n8ljmgeYgtRCsuW7YixkcsopQedJ4fVfEVj08XKpzFKOmBU7Q/hAIOzp46PUsGxtoebW5m6YQ1/33H/slGqSIYwizyoLPVOW59IgBu8cd/7Qu8lAeUDm82Sz5Aur/pKwTtzLMTf4XZBnSfUmI7crEwq1telgY4DvCyNzFn7tUKM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777418829; c=relaxed/simple;\n bh=mw9H5QVvCfwTtEfM5Q8OoZz5fHIHH8xnvyUzlq89viA=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=v/8PphkM9UziwtYogt0pkVBFmVyfa/iVk7AmhtHJ41HnoKMmZ18YQh8Ei49GmXFEeU1z2ogyQX4mU2J69DEZV9sw3Z5je173iLznsLzI4G0JL2nskdPqB5l6/c8ya5CBrZzHP75yjWUjUlK1qeuTTdz/P2LkgZEMVTlpzOxccQg=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777418828;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=JvH7vNAAWwjnu6I8b0bdUOo3pPC15vm3ClfjCuETtHI=;\n b=SvSrnIeW6d1m2C1By+FcwOqo0YdNrq5kxpJrocAQAPKt2Mh9a9LyN+erDFcbOzEV3GCX8R\n +LtyoOnG1pTA5amAiwv7ElRMBXbApMJC9JlB5CZFqJIqlzHjOVaFyT6LzLydrM+0Q8xqbf\n xIQDXI2c1UXivrK29VnJvcEYN5VYZDY=","X-MC-Unique":"USHomKE7MJW3Vz_R_1mRTQ-1","X-Mimecast-MFC-AGG-ID":"USHomKE7MJW3Vz_R_1mRTQ_1777418826","From":"David Malcolm <dmalcolm@redhat.com>","To":"gcc-patches@gcc.gnu.org","Cc":"David Malcolm <dmalcolm@redhat.com>","Subject":"[pushed: r17-168] json: move pp_markup::quoted_json_pointer to its\n own header","Date":"Tue, 28 Apr 2026 19:27:04 -0400","Message-ID":"<20260428232704.1953719-1-dmalcolm@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.17","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"oJiotmcez1eUXFf0M-qWm1iOWVgaHApWWjTaoel1JD0_1777418826","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","content-type":"text/plain; charset=\"US-ASCII\"; x-default=true","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Successfully bootstrapped & regrtested on powerpc64le-unknown-linux-gnu\n(albeit without ada,cobol,d, and possibly missing some optional test dependencies)\nPushed to trunk as r17-168-gec6ac8c35d1fae.\n\ngcc/ChangeLog:\n\t* json-diagnostic.cc: Include \"pretty-print-markup-json.h\".\n\t(class pp_markup::quoted_json_pointer): Move to...\n\t* pretty-print-markup-json.h: ...this new file.\n\nSigned-off-by: David Malcolm <dmalcolm@redhat.com>\n---\n gcc/json-diagnostic.cc         | 27 +-----------------\n gcc/pretty-print-markup-json.h | 51 ++++++++++++++++++++++++++++++++++\n 2 files changed, 52 insertions(+), 26 deletions(-)\n create mode 100644 gcc/pretty-print-markup-json.h","diff":"diff --git a/gcc/json-diagnostic.cc b/gcc/json-diagnostic.cc\nindex bf61cd0007e..fced0a48ecb 100644\n--- a/gcc/json-diagnostic.cc\n+++ b/gcc/json-diagnostic.cc\n@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see\n #include \"diagnostics/text-sink.h\"\n #include \"diagnostics/physical-location-maker.h\"\n #include \"pretty-print-markup.h\"\n+#include \"pretty-print-markup-json.h\"\n \n static bool\n emit_json_diagnostic (gcc_json_context &ctxt,\n@@ -184,32 +185,6 @@ private:\n   const json::value &m_js_val;\n };\n \n-namespace pp_markup {\n-\n-/* Print the JSON Pointer of a given json::value in quotes.  */\n-\n-class quoted_json_pointer : public pp_element\n-{\n-public:\n-  quoted_json_pointer (const json::value &js_val)\n-  : m_js_val (js_val)\n-  {\n-  }\n-\n-  void\n-  add_to_phase_2 (context &ctxt) final override\n-  {\n-    ctxt.begin_quote ();\n-    m_js_val.print_pointer (&ctxt.m_pp);\n-    ctxt.end_quote ();\n-  }\n-\n-private:\n-  const json::value &m_js_val;\n-};\n-\n-} // namespace pp_markup\n-\n /* text_sink starter for diagnostics relating to JSON.  */\n \n static void\ndiff --git a/gcc/pretty-print-markup-json.h b/gcc/pretty-print-markup-json.h\nnew file mode 100644\nindex 00000000000..d10e9fb4053\n--- /dev/null\n+++ b/gcc/pretty-print-markup-json.h\n@@ -0,0 +1,51 @@\n+/* Copyright (C) 2026 Free Software Foundation, Inc.\n+   Contributed by David Malcolm <dmalcolm@redhat.com>\n+\n+This file is part of GCC.\n+\n+GCC is free software; you can redistribute it and/or modify it under\n+the terms of the GNU General Public License as published by the Free\n+Software Foundation; either version 3, or (at your option) any later\n+version.\n+\n+GCC is distributed in the hope that it will be useful, but WITHOUT ANY\n+WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\n+for more details.\n+\n+You should have received a copy of the GNU General Public License\n+along with GCC; see the file COPYING3.  If not see\n+<http://www.gnu.org/licenses/>.  */\n+\n+#ifndef GCC_PRETTY_PRINT_MARKUP_JSON_H\n+#define GCC_PRETTY_PRINT_MARKUP_JSON_H\n+\n+#include \"pretty-print-markup.h\"\n+\n+namespace pp_markup {\n+\n+/* Print the JSON Pointer of a given json::value in quotes.  */\n+\n+class quoted_json_pointer : public pp_element\n+{\n+public:\n+  quoted_json_pointer (const json::value &js_val)\n+  : m_js_val (js_val)\n+  {\n+  }\n+\n+  void\n+  add_to_phase_2 (context &ctxt) final override\n+  {\n+   ctxt.begin_quote ();\n+   m_js_val.print_pointer (&ctxt.m_pp);\n+   ctxt.end_quote ();\n+  }\n+\n+private:\n+  const json::value &m_js_val;\n+};\n+\n+} // namespace pp_markup\n+\n+#endif /* GCC_PRETTY_PRINT_MARKUP_JSON_H */\n","prefixes":["pushed:","r17-168"]}