get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2194770,
    "url": "http://patchwork.ozlabs.org/api/patches/2194770/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260209204132.1397967-3-jwakely@redhat.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": "<20260209204132.1397967-3-jwakely@redhat.com>",
    "list_archive_url": null,
    "date": "2026-02-09T15:54:22",
    "name": "[3/3] libstdc++: Optimize std::regex_traits lookup functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "df344d0ea150bd97a22f74fca3455176a8d9b66c",
    "submitter": {
        "id": 48004,
        "url": "http://patchwork.ozlabs.org/api/people/48004/?format=api",
        "name": "Jonathan Wakely",
        "email": "jwakely@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260209204132.1397967-3-jwakely@redhat.com/mbox/",
    "series": [
        {
            "id": 491567,
            "url": "http://patchwork.ozlabs.org/api/series/491567/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=491567",
            "date": "2026-02-09T15:54:21",
            "name": "[1/3] libstdc++: Improve tests for std::regex_traits::lookup_classname [PR124015]",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491567/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2194770/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2194770/checks/",
    "tags": {},
    "related": [],
    "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=BZWdzQXM;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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=BZWdzQXM",
            "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.129.124"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4f8xVD1BMVz1xwG\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 07:43:16 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 364A64CF3051\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  9 Feb 2026 20:43:14 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 943BB4CF3052\n for <gcc-patches@gcc.gnu.org>; Mon,  9 Feb 2026 20:41:41 +0000 (GMT)",
            "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-T0FVraKIPXmg6FaiIIJVpQ-1; Mon,\n 09 Feb 2026 15:41:39 -0500",
            "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 8ED3D1800451; Mon,  9 Feb 2026 20:41:38 +0000 (UTC)",
            "from zen.kayari.org (unknown [10.45.226.222])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 69BCE1800464; Mon,  9 Feb 2026 20:41:37 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 364A64CF3051",
            "OpenDKIM Filter v2.11.0 sourceware.org 943BB4CF3052"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 943BB4CF3052",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 943BB4CF3052",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770669701; cv=none;\n b=M7fRLdFhl/Ml2X0eRCJHqsf5cYPaDvN05m7j4bGgUloaXgS6M+gcTdPLPnkVKM5uvguSSVcxJPwvTvoCo8u1Qt7EANuP/wY3p7Qb1OGcumv8mly4bG5C29CWY5VG0G671nTlE1yQFvh2RKXf3Qseq2GcVe4T9sVIBCVcBJUaStY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770669701; c=relaxed/simple;\n bh=rGFMJ3k1sQZuZRZR+TsCqo5PComx28Rb2imvYQQmoXQ=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=P98hp/NMOLVKTitdcNglOyEcLz9QaA38tampt4acA/dO6zlPvLKmudDf5Jz6eZbKxdwbSrQCK8J3TONz4ybCcKtPb0BM8kCcPikFi0Xu4kkFIKsG2knPUb+OdSxAJp1PA9LcU3o17Sn7If9LeR7QNaRXrs7O91P7TRFvgsIRxAg=",
        "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=1770669701;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=SQIKmZzI1oKCbZnCA44WVx3D1xpLHBqVYFjOLCnk/Rk=;\n b=BZWdzQXMZHGI/e2P5fp6QcdREgII15QijMyXHcrnH3916YZivWhc+SMsFsY57JRhSM2ekb\n i6fo+lA58DVGJSbc1agQlqVI0oFYZzPBE/KFbo5bryszMY5vpr9nAc34W2QXEyG6OkZq1M\n WPHdEt3RrSA0GpvZGKptKOF3MzsK5zo=",
        "X-MC-Unique": "T0FVraKIPXmg6FaiIIJVpQ-1",
        "X-Mimecast-MFC-AGG-ID": "T0FVraKIPXmg6FaiIIJVpQ_1770669698",
        "From": "Jonathan Wakely <jwakely@redhat.com>",
        "To": "gcc-patches@gcc.gnu.org,\n\tlibstdc++@gcc.gnu.org",
        "Subject": "[PATCH 3/3] libstdc++: Optimize std::regex_traits lookup functions",
        "Date": "Mon,  9 Feb 2026 15:54:22 +0000",
        "Message-ID": "<20260209204132.1397967-3-jwakely@redhat.com>",
        "In-Reply-To": "<20260209204132.1397967-1-jwakely@redhat.com>",
        "References": "<20260209204132.1397967-1-jwakely@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "x09Q-M8AMfVG1iRNOqK9OvwyfMAwKKM88wGljYIfydY_1770669698",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain",
        "Content-Transfer-Encoding": "8bit",
        "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": "Optimize std::regex_traits::lookup_collatename and\nstd::regex_traits::lookup_classname.\n\nFor lookup_collatename we can hoist the static array into a\nnon-dependent function, then call that for the regex_traits<char>\nspecialization without performing any narrowing operations via the ctype\nfacet. For the regex_traits<wchar_t> specialization we populate a\nstd::string for the narrowed result, and call the non-dependent function.\n\nFor lookup_classname we can avoid the static array entirely, replacing\nthe iteration over that array with a nested switch that implements a\nkind of manually-unrolled trie, only match one char at a time until we\neither match a full string or get a mismatch. This avoids narrowing the\nentire input and storing it in a temporary string. This improves\nperformance by 2-3x for -O2 and below (the benefit is much smaller for\n-O3).\n\nWe can also check the input length for random access iterators, and\nreject any strings longer than \"xdigit\" without doing any work at all.\nFor silly cases like [:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:]\nthis gives a 100x improvement.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/regex.tcc (__detail::__lookup_collatename): New\n\tfunction.\n\t(regex_traits::lookup_collatename): Use new function. Elide\n\tredundant narrowing via ctype facet for regex_traits<char>.\n\t(regex_traits::lookup_classname): Replace lookup table with\n\thandwritten prefix match.\n---\n\nThis does not need to be backported to release branches.\n\nTested x86_64-linux.\n\n libstdc++-v3/include/bits/regex.tcc | 428 ++++++++++++++++------------\n 1 file changed, 252 insertions(+), 176 deletions(-)",
    "diff": "diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc\nindex 71eadd20bfdb..63e4cf79910c 100644\n--- a/libstdc++-v3/include/bits/regex.tcc\n+++ b/libstdc++-v3/include/bits/regex.tcc\n@@ -113,163 +113,187 @@ namespace __detail\n \t}\n       return __ret;\n     }\n+\n+  inline void\n+  __lookup_collatename(string& __name) noexcept\n+  {\n+    static const char* const __collatenames[] =\n+      {\n+\t\"NUL\",\n+\t\"SOH\",\n+\t\"STX\",\n+\t\"ETX\",\n+\t\"EOT\",\n+\t\"ENQ\",\n+\t\"ACK\",\n+\t\"alert\",\n+\t\"backspace\",\n+\t\"tab\",\n+\t\"newline\",\n+\t\"vertical-tab\",\n+\t\"form-feed\",\n+\t\"carriage-return\",\n+\t\"SO\",\n+\t\"SI\",\n+\t\"DLE\",\n+\t\"DC1\",\n+\t\"DC2\",\n+\t\"DC3\",\n+\t\"DC4\",\n+\t\"NAK\",\n+\t\"SYN\",\n+\t\"ETB\",\n+\t\"CAN\",\n+\t\"EM\",\n+\t\"SUB\",\n+\t\"ESC\",\n+\t\"IS4\",\n+\t\"IS3\",\n+\t\"IS2\",\n+\t\"IS1\",\n+\t\"space\",\n+\t\"exclamation-mark\",\n+\t\"quotation-mark\",\n+\t\"number-sign\",\n+\t\"dollar-sign\",\n+\t\"percent-sign\",\n+\t\"ampersand\",\n+\t\"apostrophe\",\n+\t\"left-parenthesis\",\n+\t\"right-parenthesis\",\n+\t\"asterisk\",\n+\t\"plus-sign\",\n+\t\"comma\",\n+\t\"hyphen\",\n+\t\"period\",\n+\t\"slash\",\n+\t\"zero\",\n+\t\"one\",\n+\t\"two\",\n+\t\"three\",\n+\t\"four\",\n+\t\"five\",\n+\t\"six\",\n+\t\"seven\",\n+\t\"eight\",\n+\t\"nine\",\n+\t\"colon\",\n+\t\"semicolon\",\n+\t\"less-than-sign\",\n+\t\"equals-sign\",\n+\t\"greater-than-sign\",\n+\t\"question-mark\",\n+\t\"commercial-at\",\n+\t\"A\",\n+\t\"B\",\n+\t\"C\",\n+\t\"D\",\n+\t\"E\",\n+\t\"F\",\n+\t\"G\",\n+\t\"H\",\n+\t\"I\",\n+\t\"J\",\n+\t\"K\",\n+\t\"L\",\n+\t\"M\",\n+\t\"N\",\n+\t\"O\",\n+\t\"P\",\n+\t\"Q\",\n+\t\"R\",\n+\t\"S\",\n+\t\"T\",\n+\t\"U\",\n+\t\"V\",\n+\t\"W\",\n+\t\"X\",\n+\t\"Y\",\n+\t\"Z\",\n+\t\"left-square-bracket\",\n+\t\"backslash\",\n+\t\"right-square-bracket\",\n+\t\"circumflex\",\n+\t\"underscore\",\n+\t\"grave-accent\",\n+\t\"a\",\n+\t\"b\",\n+\t\"c\",\n+\t\"d\",\n+\t\"e\",\n+\t\"f\",\n+\t\"g\",\n+\t\"h\",\n+\t\"i\",\n+\t\"j\",\n+\t\"k\",\n+\t\"l\",\n+\t\"m\",\n+\t\"n\",\n+\t\"o\",\n+\t\"p\",\n+\t\"q\",\n+\t\"r\",\n+\t\"s\",\n+\t\"t\",\n+\t\"u\",\n+\t\"v\",\n+\t\"w\",\n+\t\"x\",\n+\t\"y\",\n+\t\"z\",\n+\t\"left-curly-bracket\",\n+\t\"vertical-line\",\n+\t\"right-curly-bracket\",\n+\t\"tilde\",\n+\t\"DEL\",\n+      };\n+\n+    for (const auto& __it : __collatenames)\n+      if (__name == __it)\n+\t{\n+\t  __name.assign(1, static_cast<char>(&__it - __collatenames));\n+\t  return;\n+\t}\n+\n+    __name.clear();\n+  }\n+\n   /// @endcond\n } // namespace __detail\n \n+#pragma GCC diagnostic push\n+#pragma GCC diagnostic ignored \"-Wc++17-extensions\" // if constexpr\n+\n   template<typename _Ch_type>\n   template<typename _Fwd_iter>\n     typename regex_traits<_Ch_type>::string_type\n     regex_traits<_Ch_type>::\n     lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const\n     {\n-      typedef std::ctype<char_type> __ctype_type;\n-      const __ctype_type& __fctyp(use_facet<__ctype_type>(_M_locale));\n-\n-      static const char* const __collatenames[] =\n-\t{\n-\t  \"NUL\",\n-\t  \"SOH\",\n-\t  \"STX\",\n-\t  \"ETX\",\n-\t  \"EOT\",\n-\t  \"ENQ\",\n-\t  \"ACK\",\n-\t  \"alert\",\n-\t  \"backspace\",\n-\t  \"tab\",\n-\t  \"newline\",\n-\t  \"vertical-tab\",\n-\t  \"form-feed\",\n-\t  \"carriage-return\",\n-\t  \"SO\",\n-\t  \"SI\",\n-\t  \"DLE\",\n-\t  \"DC1\",\n-\t  \"DC2\",\n-\t  \"DC3\",\n-\t  \"DC4\",\n-\t  \"NAK\",\n-\t  \"SYN\",\n-\t  \"ETB\",\n-\t  \"CAN\",\n-\t  \"EM\",\n-\t  \"SUB\",\n-\t  \"ESC\",\n-\t  \"IS4\",\n-\t  \"IS3\",\n-\t  \"IS2\",\n-\t  \"IS1\",\n-\t  \"space\",\n-\t  \"exclamation-mark\",\n-\t  \"quotation-mark\",\n-\t  \"number-sign\",\n-\t  \"dollar-sign\",\n-\t  \"percent-sign\",\n-\t  \"ampersand\",\n-\t  \"apostrophe\",\n-\t  \"left-parenthesis\",\n-\t  \"right-parenthesis\",\n-\t  \"asterisk\",\n-\t  \"plus-sign\",\n-\t  \"comma\",\n-\t  \"hyphen\",\n-\t  \"period\",\n-\t  \"slash\",\n-\t  \"zero\",\n-\t  \"one\",\n-\t  \"two\",\n-\t  \"three\",\n-\t  \"four\",\n-\t  \"five\",\n-\t  \"six\",\n-\t  \"seven\",\n-\t  \"eight\",\n-\t  \"nine\",\n-\t  \"colon\",\n-\t  \"semicolon\",\n-\t  \"less-than-sign\",\n-\t  \"equals-sign\",\n-\t  \"greater-than-sign\",\n-\t  \"question-mark\",\n-\t  \"commercial-at\",\n-\t  \"A\",\n-\t  \"B\",\n-\t  \"C\",\n-\t  \"D\",\n-\t  \"E\",\n-\t  \"F\",\n-\t  \"G\",\n-\t  \"H\",\n-\t  \"I\",\n-\t  \"J\",\n-\t  \"K\",\n-\t  \"L\",\n-\t  \"M\",\n-\t  \"N\",\n-\t  \"O\",\n-\t  \"P\",\n-\t  \"Q\",\n-\t  \"R\",\n-\t  \"S\",\n-\t  \"T\",\n-\t  \"U\",\n-\t  \"V\",\n-\t  \"W\",\n-\t  \"X\",\n-\t  \"Y\",\n-\t  \"Z\",\n-\t  \"left-square-bracket\",\n-\t  \"backslash\",\n-\t  \"right-square-bracket\",\n-\t  \"circumflex\",\n-\t  \"underscore\",\n-\t  \"grave-accent\",\n-\t  \"a\",\n-\t  \"b\",\n-\t  \"c\",\n-\t  \"d\",\n-\t  \"e\",\n-\t  \"f\",\n-\t  \"g\",\n-\t  \"h\",\n-\t  \"i\",\n-\t  \"j\",\n-\t  \"k\",\n-\t  \"l\",\n-\t  \"m\",\n-\t  \"n\",\n-\t  \"o\",\n-\t  \"p\",\n-\t  \"q\",\n-\t  \"r\",\n-\t  \"s\",\n-\t  \"t\",\n-\t  \"u\",\n-\t  \"v\",\n-\t  \"w\",\n-\t  \"x\",\n-\t  \"y\",\n-\t  \"z\",\n-\t  \"left-curly-bracket\",\n-\t  \"vertical-line\",\n-\t  \"right-curly-bracket\",\n-\t  \"tilde\",\n-\t  \"DEL\",\n-\t};\n-\n-      string __s;\n-      for (; __first != __last; ++__first)\n-\t__s += __fctyp.narrow(*__first, 0);\n-\n-      for (const auto& __it : __collatenames)\n-\tif (__s == __it)\n-\t  return string_type(1, __fctyp.widen(\n-\t    static_cast<char>(&__it - __collatenames)));\n-\n       // TODO Add digraph support:\n       // http://boost.sourceforge.net/libs/regex/doc/collating_names.html\n \n-      return string_type();\n+      if constexpr (is_same<char_type, char>::value)\n+\t{\n+\t  string __s(__first, __last);\n+\t  __detail::__lookup_collatename(__s);\n+\t  return __s;\n+\t}\n+      else\n+\t{\n+\t  typedef std::ctype<char_type> __ctype_type;\n+\t  const __ctype_type& __fctyp(use_facet<__ctype_type>(_M_locale));\n+\n+\t  string __s;\n+\t  for (; __first != __last; ++__first)\n+\t    __s += __fctyp.narrow(*__first, 0);\n+\t  __detail::__lookup_collatename(__s);\n+\t  if (__s.empty())\n+\t    return string_type();\n+\t  else\n+\t    return string_type(1, __fctyp.widen(__s[0]));\n+\t}\n     }\n \n   template<typename _Ch_type>\n@@ -278,43 +302,97 @@ namespace __detail\n     regex_traits<_Ch_type>::\n     lookup_classname(_Fwd_iter __first, _Fwd_iter __last, bool __icase) const\n     {\n+      if constexpr (__is_any_random_access_iter<_Fwd_iter>::value)\n+\tif ((__last - __first) > 6) [[__unlikely__]]\n+\t  return {}; // \"xdigit\" is the longest classname\n+\n       typedef std::ctype<char_type> __ctype_type;\n       const __ctype_type& __fctyp(use_facet<__ctype_type>(_M_locale));\n \n-      // Mappings from class name to class mask.\n-      static const pair<const char*, char_class_type> __classnames[] =\n-      {\n-\t{\"d\", ctype_base::digit},\n-\t{\"w\", {ctype_base::alnum, _RegexMask::_S_under}},\n-\t{\"s\", ctype_base::space},\n-\t{\"alnum\", ctype_base::alnum},\n-\t{\"alpha\", ctype_base::alpha},\n-\t{\"blank\", ctype_base::blank},\n-\t{\"cntrl\", ctype_base::cntrl},\n-\t{\"digit\", ctype_base::digit},\n-\t{\"graph\", ctype_base::graph},\n-\t{\"lower\", ctype_base::lower},\n-\t{\"print\", ctype_base::print},\n-\t{\"punct\", ctype_base::punct},\n-\t{\"space\", ctype_base::space},\n-\t{\"upper\", ctype_base::upper},\n-\t{\"xdigit\", ctype_base::xdigit},\n+      auto __read_ch = [&]() -> char {\n+\tif (__first == __last)\n+\t  return '\\0';\n+\tchar __c = __fctyp.narrow(__fctyp.tolower(*__first), 0);\n+\t++__first;\n+\treturn __c;\n       };\n \n-      string __s;\n-      for (; __first != __last; ++__first)\n-\t__s += __fctyp.narrow(__fctyp.tolower(*__first), 0);\n+      auto __match = [&](const char* __s) -> bool {\n+\tdo\n+\t  if (__read_ch() != *__s)\n+\t    return false;\n+\twhile (*++__s);\n+\treturn __first == __last;\n+      };\n \n-      for (const auto& __it : __classnames)\n-\tif (__s == __it.first)\n+      switch(__read_ch())\n+\t{\n+\tcase 'a':\n+\t  if (__read_ch() == 'l')\n+\t    switch (__read_ch())\n+\t      {\n+\t      case 'n':\n+\t\tif (__match(\"um\"))\n+\t\t  return ctype_base::alnum;\n+\t\tbreak;\n+\t      case 'p':\n+\t\tif (__match(\"ha\"))\n+\t\t  return ctype_base::alpha;\n+\t\tbreak;\n+\t      }\n+\t  break;\n+\tcase 'b':\n+\t  if (__match(\"lank\"))\n+\t    return ctype_base::blank;\n+\t  break;\n+\tcase 'c':\n+\t  if (__match(\"ntrl\"))\n+\t    return ctype_base::cntrl;\n+\t  break;\n+\tcase 'd':\n+\t  if (__first == __last || __match(\"igit\"))\n+\t    return ctype_base::digit;\n+\t  break;\n+\tcase 'g':\n+\t  if (__match(\"raph\"))\n+\t    return ctype_base::graph;\n+\t  break;\n+\tcase 'l':\n+\t  if (__match(\"ower\"))\n+\t    return __icase ? ctype_base::alpha : ctype_base::lower;\n+\t  break;\n+\tcase 'p':\n+\t  switch (__read_ch())\n \t  {\n-\t    if (__icase\n-\t\t&& (__it.second._M_base == ctype_base::lower\n-\t\t      || __it.second._M_base == ctype_base::upper))\n-\t      return ctype_base::alpha;\n-\t    return __it.second;\n+\t  case 'r':\n+\t    if (__match(\"int\"))\n+\t      return ctype_base::print;\n+\t    break;\n+\t  case 'u':\n+\t    if (__match(\"nct\"))\n+\t      return ctype_base::punct;\n+\t    break;\n \t  }\n-      return 0;\n+\t  break;\n+\tcase 's':\n+\t  if (__first == __last || __match(\"pace\"))\n+\t    return ctype_base::space;\n+\t  break;\n+\tcase 'u':\n+\t  if (__match(\"pper\"))\n+\t    return __icase ? ctype_base::alpha : ctype_base::upper;\n+\t  break;\n+\tcase 'w':\n+\t  if (__first == __last)\n+\t    return {ctype_base::alnum, char_class_type::_S_under};\n+\t  break;\n+\tcase 'x':\n+\t  if (__match(\"digit\"))\n+\t    return ctype_base::xdigit;\n+\t  break;\n+\t}\n+\n+      return {};\n     }\n \n   template<typename _Ch_type>\n@@ -331,8 +409,6 @@ namespace __detail\n \t    && __c == __fctyp.widen('_'));\n     }\n \n-#pragma GCC diagnostic push\n-#pragma GCC diagnostic ignored \"-Wc++17-extensions\" // if constexpr\n   template<typename _Ch_type>\n     int\n     regex_traits<_Ch_type>::\n",
    "prefixes": [
        "3/3"
    ]
}