get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/810536/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 810536,
    "url": "http://patchwork.ozlabs.org/api/patches/810536/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170906115649.GA140817@adacore.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api",
        "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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170906115649.GA140817@adacore.com>",
    "list_archive_url": null,
    "date": "2017-09-06T11:56:49",
    "name": "[Ada] Dimensional checking and generic subprograms",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "21088a5972f6433a7c1a7e995ce56f59bce267fc",
    "submitter": {
        "id": 4418,
        "url": "http://patchwork.ozlabs.org/api/people/4418/?format=api",
        "name": "Arnaud Charlet",
        "email": "charlet@adacore.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20170906115649.GA140817@adacore.com/mbox/",
    "series": [
        {
            "id": 1777,
            "url": "http://patchwork.ozlabs.org/api/series/1777/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=1777",
            "date": "2017-09-06T11:56:49",
            "name": "[Ada] Dimensional checking and generic subprograms",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1777/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/810536/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/810536/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-461591-incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "mailing list gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461591-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"mMWH6CZO\"; dkim-atps=neutral",
            "sourceware.org; auth=none"
        ],
        "Received": [
            "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnMWl5Fnkz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 21:57:07 +1000 (AEST)",
            "(qmail 56609 invoked by alias); 6 Sep 2017 11:56:53 -0000",
            "(qmail 56429 invoked by uid 89); 6 Sep 2017 11:56:52 -0000",
            "from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 06 Sep 2017 11:56:50 +0000",
            "from localhost (localhost.localdomain [127.0.0.1])\tby\n\tfiltered-rock.gnat.com (Postfix) with ESMTP id 17DB05614D;\n\tWed,  6 Sep 2017 07:56:49 -0400 (EDT)",
            "from rock.gnat.com ([127.0.0.1])\tby localhost (rock.gnat.com\n\t[127.0.0.1]) (amavisd-new, port 10024)\twith LMTP id\n\tF2B7IKmFE17W; Wed,  6 Sep 2017 07:56:49 -0400 (EDT)",
            "from tron.gnat.com (tron.gnat.com [205.232.38.10])\tby\n\trock.gnat.com (Postfix) with ESMTP id 0689556142;\n\tWed,  6 Sep 2017 07:56:49 -0400 (EDT)",
            "by tron.gnat.com (Postfix, from userid 4192)\tid 0584E4AC;\n\tWed,  6 Sep 2017 07:56:49 -0400 (EDT)"
        ],
        "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:mime-version:content-type; q=dns;\n\ts=default; b=StqWYjdLKaAq7h4gO7NjtfEf9YPgPLCNg8cXAJw9wyIskq+5By\n\t3NarD9JbEoG5rPX41TEK97HNxaVzEZ8Cs69ATxbkkfPJxCkfZ92ZlStGiNDbAmBM\n\tFR4a29KHNfA0Q/pFfoK3UnlC5zq5msrqrl+RvwmocXmxnRvFWVAZGQsHE=",
        "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:mime-version:content-type; s=\n\tdefault; bh=zNETeY3k8lxF8vCdEm0YlGS2fzQ=; b=mMWH6CZOK/nnXpIYkRXa\n\ta+Xdi+SqYXy7sI1WBYq6eWY/9lLc9RzHeGBUWy2pE0Fvb5aKohmoPDL4/qz0WCtu\n\tAoOru9zOlFclBqJI1F3heN6OOaaRKv/CY0Ltj9qgtBBznkX9sn/Y/Rguo+bgTgla\n\t6ZJemWSu+esyk+7mAId8Kws=",
        "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm",
        "Precedence": "bulk",
        "List-Id": "<gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>",
        "Sender": "gcc-patches-owner@gcc.gnu.org",
        "X-Virus-Found": "No",
        "X-Spam-SWARE-Status": "No, score=-10.4 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=Dimensional,\n\tintegrate",
        "X-HELO": "rock.gnat.com",
        "Date": "Wed, 6 Sep 2017 07:56:49 -0400",
        "From": "Arnaud Charlet <charlet@adacore.com>",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "Ed Schonberg <schonberg@adacore.com>",
        "Subject": "[Ada] Dimensional checking and generic subprograms",
        "Message-ID": "<20170906115649.GA140817@adacore.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/mixed; boundary=\"nFreZHaLTZJo0R7j\"",
        "Content-Disposition": "inline",
        "User-Agent": "Mutt/1.5.23 (2014-03-12)"
    },
    "content": "This patch enahnces dimensionality checking to cover generic subprograms that\nare intended to apply to types of different dimensions, such as an integration\nfunction. Dimensionality checking is performed in each instance. and rely on\na special handling of conversion operations to prevent spurious dimensional\nerrors in the generic unit itself.\n\nThe following must compile quietly:\n\n   gcc -c -gnatws integrate.adb\n\n--- \npackage Dims with SPARK_Mode is\n\n    -----------------------------------------\n    -- Setup Dimension System\n    -----------------------------------------\n    type Unit_Type is new Float with Dimension_System =>\n        ((Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),\n         (Unit_Name => Kilogram, Unit_Symbol => \"kg\", Dim_Symbol => 'M'),\n         (Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'),\n         (Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'),\n         (Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => \"Theta\"),\n         (Unit_Name => Radian, Unit_Symbol => \"Rad\", Dim_Symbol => \"A\")),\n   Default_Value => 0.0; \n\n   -- Base Dimensions\n   subtype Length_Type is Unit_Type with\n        Dimension => (Symbol => 'm', Meter => 1, others => 0);  \n \n   subtype Time_Type is Unit_Type with\n        Dimension => (Symbol => 's', Second => 1, others => 0);   \n\n   subtype Linear_Velocity_Type is Unit_Type with\n        Dimension => (Meter => 1, Second => -1, others => 0);   \n\n   -- Base Units\n   Meter    : constant Length_Type := Length_Type (1.0);\n   Second   : constant Time_Type   := Time_Type (1.0);\nend dims;\n---\nwith Dims; use Dims;\nprocedure Integrate is\n   generic\n      type Op1 is new Unit_Type;\n      type Op2 is new Unit_Type;\n      type Res is new Unit_Type;\n   function I (X : op1; Y : Op2) return Res;\n   function I (X : op1; Y : Op2) return Res is\n   begin\n      return Res (Unit_Type (X) *  Unit_type (Y));\n   end I;\n\n   function Distance is new I (Time_Type, Linear_Velocity_Type, Length_Type);\n   Secs : Time_Type := 5.0;\n   Speed : Linear_Velocity_Type := 10.0;\n   Covered : Length_Type;\nbegin\n   Covered  := Distance (Secs, Speed);\n\n   declare\n      subtype Area is Unit_Type with dimension =>\n         (Meter => 2, others => 0);\n      My_Little_Acre : Area;\n      function Acres is new I (Length_Type, Length_Type, Area);\n    begin\n       My_Little_Acre := Covered * Covered;\n       My_Little_Acre := Acres (Covered, Covered);\n    end;\nend Integrate;\n\nTested on x86_64-pc-linux-gnu, committed on trunk\n\n2017-09-06  Ed Schonberg  <schonberg@adacore.com>\n\n\t* sem_dim.adb (Analyze_Dimension): In an instance, a type\n\tconversion takes its dimensions from the expression, not from\n\tthe context type.\n\t(Dimensions_Of_Operand): Ditto.",
    "diff": "Index: sem_dim.adb\n===================================================================\n--- sem_dim.adb\t(revision 251753)\n+++ sem_dim.adb\t(working copy)\n@@ -1161,7 +1161,6 @@\n             | N_Qualified_Expression\n             | N_Selected_Component\n             | N_Slice\n-            | N_Type_Conversion\n             | N_Unchecked_Type_Conversion\n          =>\n             Analyze_Dimension_Has_Etype (N);\n@@ -1191,7 +1190,17 @@\n          when N_Subtype_Declaration =>\n             Analyze_Dimension_Subtype_Declaration (N);\n \n+         when  N_Type_Conversion =>\n+            if In_Instance\n+              and then Exists (Dimensions_Of (Expression (N)))\n+            then\n+               Set_Dimensions (N, Dimensions_Of (Expression (N)));\n+            else\n+               Analyze_Dimension_Has_Etype (N);\n+            end if;\n+\n          when N_Unary_Op =>\n+\n             Analyze_Dimension_Unary_Op (N);\n \n          when others =>\n@@ -1378,11 +1387,24 @@\n \n          --  A type conversion may have been inserted to rewrite other\n          --  expressions, e.g. function returns. Dimensions are those of\n-         --  the target type.\n+         --  the target type, unless this is a conversion in an instance,\n+         --  in which case the proper dimensions are those of the operand,\n \n          elsif Nkind (N) = N_Type_Conversion then\n-            return Dimensions_Of (Etype (N));\n+            if In_Instance\n+              and then Is_Generic_Actual_Type (Etype (Expression (N)))\n+            then\n+               return Dimensions_Of (Etype (Expression (N)));\n \n+            elsif In_Instance\n+              and then Exists (Dimensions_Of (Expression (N)))\n+            then\n+               return Dimensions_Of (Expression (N));\n+\n+            else\n+               return Dimensions_Of (Etype (N));\n+            end if;\n+\n          --  Otherwise return the default dimensions\n \n          else\n",
    "prefixes": [
        "Ada"
    ]
}