Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196451/?format=api
{ "id": 2196451, "url": "http://patchwork.ozlabs.org/api/patches/2196451/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260214011613.7297-1-soggysocks206@gmail.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": "<20260214011613.7297-1-soggysocks206@gmail.com>", "list_archive_url": null, "date": "2026-02-14T01:15:21", "name": "[v2] c++: revert fix for PR41127 [PR118374]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "092527a76035f88b82b7691939c9804510cd6863", "submitter": { "id": 91423, "url": "http://patchwork.ozlabs.org/api/people/91423/?format=api", "name": "Ben Wu", "email": "soggysocks206@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260214011613.7297-1-soggysocks206@gmail.com/mbox/", "series": [ { "id": 492152, "url": "http://patchwork.ozlabs.org/api/series/492152/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=492152", "date": "2026-02-14T01:15:21", "name": "[v2] c++: revert fix for PR41127 [PR118374]", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492152/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196451/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196451/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 (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=aL3limD1;\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 (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=aL3limD1", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.214.170" ], "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 4fCWNR3cJTz1xr1\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 12:17:11 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D56764BAD148\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 01:17:08 +0000 (GMT)", "from mail-pl1-f170.google.com (mail-pl1-f170.google.com\n [209.85.214.170])\n by sourceware.org (Postfix) with ESMTPS id 162574B9DB5B\n for <gcc-patches@gcc.gnu.org>; Sat, 14 Feb 2026 01:16:39 +0000 (GMT)", "by mail-pl1-f170.google.com with SMTP id\n d9443c01a7336-2a7a9b8ed69so14225275ad.2\n for <gcc-patches@gcc.gnu.org>; Fri, 13 Feb 2026 17:16:39 -0800 (PST)", "from PC.lan (71-212-83-35.tukw.qwest.net. [71.212.83.35])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2ad1aadd9e8sm3231325ad.74.2026.02.13.17.16.36\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 13 Feb 2026 17:16:37 -0800 (PST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org D56764BAD148", "OpenDKIM Filter v2.11.0 sourceware.org 162574B9DB5B" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 162574B9DB5B", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 162574B9DB5B", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771031799; cv=none;\n b=vv7UYMV1VkKXNUrkxPBzvb4iypIZnc+qj/9WwgBWudV4kdX+MVeCUaz8OpWEujkBF9w36GpXZBxaJRi/ieEc+aorcPfmqedfoyad8Q13OIaXnEbGXcED6mk+P/S+juNXG3K64gDLNH7KGMEUfpi1dgkPocX0wWNcZv6YpVMblAU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1771031799; c=relaxed/simple;\n bh=IALyOa+vC4nzj92r2Kcau/UkYLMTZvogGkUgU//EPq4=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=xQeWsmQ2PTfDNgjXWurO+LR7EMVCd2stV5ZUhErvIuVnslzDCl2DzS9hFT2aHKHj8aHWRkF6LrvI2ZK/XELRwoLSaqHYrwi6ycVU3O7y1xDysttFtkX6k1sXc68xgZDEcV5uoXTF92UhNeKNF7Y+KuIXIznQBIbWWM571v5/pd4=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1771031798; x=1771636598; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=xRCKpywr3mpc77Ok/nnjVTx0G4gAE5RAwBDfuUje+WI=;\n b=aL3limD1l3nlSGqGuuyTXCe9ncat+/t68OWFQZgPYxqQ8VS7iEFIQiFX+ngUkNxXsb\n UcR4FShCtXgiBVFLouyvisrI6iITE+4KZITGu+bQOWH5pz/2RAfM0YgiYInqD4n9hcor\n FiNg1DfU2OnT1Cw3JLdKoirOImFkaqOYxZ9j6L+/6rYrZRHlj+Iy8iMC25Y3jMGlmfbn\n ADyVhOKfoVfRNcu1uKfvtM9QWc4lfaJtio8r/mb4LaTRtEB9YZ/YW816gD6mjQGXzS2n\n kl77SVmtF9M7Ev53CkI5ysMlvdjupPj/mCr86/hvk0MbAesa9Hrh18UrT+pAo4k3AYf1\n zgQQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771031798; x=1771636598;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=xRCKpywr3mpc77Ok/nnjVTx0G4gAE5RAwBDfuUje+WI=;\n b=Kg5zNjKfVMv5wN2wPTD2BWogpE/J/o55G5iBLgu+U5CQsRaU1BTJF9uzsHgQQSxc7k\n mhgbf7kwAVfJDBZjdYtVut+La+f2uF2d9/mi0p4p4y4lUNIQwRaUq3aJKw2hKHXzDIjB\n TGuVvwdwV9qxjWR7CInS3zFX+Yp8+I0YyYFup+RULDlScnUioMaQ2RtkAi28IFIe7RZg\n w1W2jiy+/S5PBjTlaEJ6TeorYBYOMJ4dJoUV1pDt10qQ/RwLM7xvtxJ85CKtE40m1aIW\n a2RrPbakzI1pm6m/MOt6FRL57fzF4E+YoTAJ4Vnmvl2/sfiRqlKY3xzibuiZgabauJj/\n mxfA==", "X-Gm-Message-State": "AOJu0Yz1SXiKB+gr9v/Ng/WXxVIkxX9OeoKG9XI/RaN2jbYRjos7YK+G\n 8joQR2b20BFLaMRM3Hz7pQc15kkUCOhsLMuBy9lqlIpsRDYIv2LvF6G/CK3URLGt", "X-Gm-Gg": "AZuq6aICxFWd24iUzA4FKc6kFmMFD1n/N4pACpZ1FUOm/9DokOv3UjUzn2VKeeHXjxH\n zL8Tij9vPwCJe1rgcsoIED7lQaFZ1ObrkVXR9v6pdEx/tH1p7PxlnjiDkbUnjzE2l7Aq6fKH0/A\n 0WmI6U2vZCldUBy1T51y9d1EzaslIm/vugTcQ36XqyoRoGJ/GAw+yuJszLACg5dQG5W8N0XVRlC\n wXVW7PNVMS9fjgyAJ6TCE6D4rObQSYHuVrcky5uVWcOcRMSdSECAkg85UQ86a8dnyaW1LK/ddXk\n z7gP68UNphpoPmuGGMJEWsvcKr7QnpC43XJSsW+kWHgqYM7g8E1kyEI19qu3ckVFoHBSYcKEUJf\n b2agBWg9A89WjpCNQuu3W4MvbQiQZFN6v3Pn1QKSxyWYP3HYpQyThCqFRPPDiTpiOemYk2FsMvZ\n JO9TGJJA/1RDixc/OyquF6xvszvqqgdjHsdJJG9c7IHCDhI9OpMzgFtKGq4KihTB78+tWHv82WO\n Id7Wgxev4U/e7AmFTwpnZEZg4tfdDbYJp8I+ZI4isxK2E1uO3bTEFSjI1OKjchK9q2oIJoQ8Ttd\n CZbcr6oYHzJ85qQNVlb4ry3xEUdwrdEl", "X-Received": "by 2002:a17:903:3805:b0:2a1:3cd9:a737 with SMTP id\n d9443c01a7336-2ab50598d8fmr47257355ad.36.1771031797708;\n Fri, 13 Feb 2026 17:16:37 -0800 (PST)", "From": "Ben Wu <soggysocks206@gmail.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "jason@redhat.com,\n\tBen Wu <soggysocks206@gmail.com>", "Subject": "[PATCH v2] c++: revert fix for PR41127 [PR118374]", "Date": "Fri, 13 Feb 2026 17:15:21 -0800", "Message-ID": "<20260214011613.7297-1-soggysocks206@gmail.com>", "X-Mailer": "git-send-email 2.52.0", "MIME-Version": "1.0", "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": "Bootstrapped and tested on x86_64-pc-linux-gnu. I don't understand why\nwe give the scoped enum pedantic error in parse/enum5.C, so maybe we can\nremove that pedwarn? I don't see why it would be helpful when parsing an\nenum-base...\n\nSee https://gcc.gnu.org/pipermail/gcc-patches/2026-February/708061.html\nfor v1.\n\n-- 8< --\n\nPreviously, we did not parse definitely in cp_parser_enum_specifier\nafter seeing CPP_COLON, since we allowed for bitfield widths to follow\n\"enum identifier :\" in member-declarations. However, ISO says that in\nsuch a situation, the colon should be parsed as an enum-base\n([dcl.enum]/a), which means bitfield widths are not allowed. This\npatch reverts the changes which allowed for bitfield widths, since\nparsing definitely improves diagnostics for errant underlying types.\n\n\tPR c++/118374\n\ngcc/cp/ChangeLog:\n\n\t* parser.cc (cp_parser_enum_specifier): Parse definitely\n\tbefore cp_parser_type_specifier_seq.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/cpp0x/enum1.C: Update test.\n\t* g++.dg/parse/enum5.C: Expect error with bitfield width\n\tand enum-key in member.\n\t* g++.dg/cpp0x/enum45.C: New test.\n---\n gcc/cp/parser.cc | 24 +++++++++++++-----------\n gcc/testsuite/g++.dg/cpp0x/enum1.C | 2 +-\n gcc/testsuite/g++.dg/cpp0x/enum45.C | 4 ++++\n gcc/testsuite/g++.dg/parse/enum5.C | 2 +-\n 4 files changed, 19 insertions(+), 13 deletions(-)\n create mode 100644 gcc/testsuite/g++.dg/cpp0x/enum45.C", "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex 0f53ff90215..f550ead1fb4 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -23838,26 +23838,18 @@ cp_parser_enum_specifier (cp_parser* parser)\n pop_deferring_access_checks ();\n \n /* Check for the `:' that denotes a specified underlying type in C++0x.\n- Note that a ':' could also indicate a bitfield width, however. */\n+ [dcl.enum]/1 says that a `:' following an enum-key is parsed as part\n+ of an enum-base, so we can expect a type-specifier-seq rather than a\n+ bitfield width. */\n location_t colon_loc = UNKNOWN_LOCATION;\n if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))\n {\n cp_decl_specifier_seq type_specifiers;\n \n- /* Consume the `:'. */\n- colon_loc = cp_lexer_peek_token (parser->lexer)->location;\n- cp_lexer_consume_token (parser->lexer);\n-\n auto tdf\n \t= make_temp_override (parser->type_definition_forbidden_message,\n \t\t\t G_(\"types may not be defined in enum-base\"));\n \n- /* Parse the type-specifier-seq. */\n- cp_parser_type_specifier_seq (parser, CP_PARSER_FLAGS_NONE,\n-\t\t\t\t /*is_declaration=*/false,\n-\t\t\t\t /*is_trailing_return=*/false,\n- &type_specifiers);\n-\n /* At this point this is surely not elaborated type specifier. */\n if (!cp_parser_parse_definitely (parser))\n \treturn NULL_TREE;\n@@ -23865,8 +23857,18 @@ cp_parser_enum_specifier (cp_parser* parser)\n if (cxx_dialect < cxx11)\n maybe_warn_cpp0x (CPP0X_SCOPED_ENUMS);\n \n+ /* Consume the `:'. */\n+ colon_loc = cp_lexer_peek_token (parser->lexer)->location;\n+ cp_lexer_consume_token (parser->lexer);\n+\n has_underlying_type = true;\n \n+ /* Parse the type-specifier-seq. */\n+ cp_parser_type_specifier_seq (parser, CP_PARSER_FLAGS_NONE,\n+\t\t\t\t /*is_declaration=*/false,\n+\t\t\t\t /*is_trailing_return=*/false,\n+\t\t\t\t &type_specifiers);\n+\n /* If that didn't work, stop. */\n if (type_specifiers.type != error_mark_node)\n {\ndiff --git a/gcc/testsuite/g++.dg/cpp0x/enum1.C b/gcc/testsuite/g++.dg/cpp0x/enum1.C\nindex bf174295248..49d0fe1519d 100644\n--- a/gcc/testsuite/g++.dg/cpp0x/enum1.C\n+++ b/gcc/testsuite/g++.dg/cpp0x/enum1.C\n@@ -1,5 +1,5 @@\n // PR c++/38021\n // { dg-do compile { target c++11 } }\n \n-enum : { };\t// { dg-error \"expected\" }\n+enum : { };\t// { dg-error \"expected|ISO\" }\n enum : 3 { };\t// { dg-error \"expected\" }\ndiff --git a/gcc/testsuite/g++.dg/cpp0x/enum45.C b/gcc/testsuite/g++.dg/cpp0x/enum45.C\nnew file mode 100644\nindex 00000000000..c9f66d7be56\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/cpp0x/enum45.C\n@@ -0,0 +1,4 @@\n+// PR c++/118374\n+// { dg-do compile { target c++11 } }\n+\n+enum class X : int8_t; // { dg-error \"does not name a type\" }\ndiff --git a/gcc/testsuite/g++.dg/parse/enum5.C b/gcc/testsuite/g++.dg/parse/enum5.C\nindex 18480520a6f..3d2b0820934 100644\n--- a/gcc/testsuite/g++.dg/parse/enum5.C\n+++ b/gcc/testsuite/g++.dg/parse/enum5.C\n@@ -7,7 +7,7 @@ typedef unsigned int T;\n struct D {\n T : sizeof(unsigned int) * CHAR_BIT; // OK\n EE : sizeof(EE) * CHAR_BIT; // OK\n- enum EE : sizeof(EE) * CHAR_BIT; // not OK\n+ enum EE : sizeof(EE) * CHAR_BIT; // { dg-error \"expected|scoped\" }\n enum EE xxxx : sizeof(EE) * CHAR_BIT; // OK\n T x : sizeof(unsigned int) * CHAR_BIT; // OK\n enum FF {ff} : sizeof(FF) * CHAR_BIT; // OK\n", "prefixes": [ "v2" ] }