From patchwork Mon Oct 16 23:02:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77909 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E9873858C66 for ; Mon, 16 Oct 2023 23:06:30 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id DC0763858D37 for ; Mon, 16 Oct 2023 23:05:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC0763858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DC0763858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497537; cv=none; b=PZjIOG8sYPHDtQ4rmjc0V6jiboITjpX57cHQOvInoC5rCImXkbx4JShEPh2V8AxxyBSpNIzXoeUnKx+DSE2ZiTLN62SpFjN2rZtC4Aj1EMP4IldqG75+ThCqk0p+stwaJsRVX2Q34oBkI4mHJOzTqIUl1gd1UQ4GPfyz69n3Ee8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497537; c=relaxed/simple; bh=cxzIHtsS1fuO+YpmFuQucvJ59WJx4Wera45BsnD/Ke4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZcD5OkPHqPJGJUlIGLtQWUp6Tteih+k1WFrLSkR2hObZ2h2akdgOXEpGcYzf1Zgb7uyi2j6o7iNhSRroz3aXMyMVNk21HDud0W9gJ1yD5L1zkQHyzs++58Aittu8L9gQpW2yHZVKoOh80xbU3OH8jnCc7HzkFROcG8y+rIsc8CQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id sWZ9qnT7uq5JYsWeQqP1yf; Mon, 16 Oct 2023 23:05:30 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWePql1t398c4sWePqy2sw; Mon, 16 Oct 2023 23:05:29 +0000 X-Authority-Analysis: v=2.4 cv=Ebzb/dqC c=1 sm=1 tr=0 ts=652dc1b9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=_ObrBsonMjXWrkZfgBUA:9 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=V0z4vupRzSwSAJCxP+4hlUW7Iq+VE7S4X4NsvIbGf3Q=; b=okUTQ8b+Gz3D7Xhu5XMfhGT3Y+ ZDQlDBMhBTM5HL5AAfnzLsOJ+kuHsFp6aJV93C7H4FYhmMvBk01e0zPO8C4xWPpbapfmGCg3pz464 GEs5FT4goQAkyeMoSjLNbOyhs; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeO-003Maa-2N; Mon, 16 Oct 2023 17:05:28 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/7] Use C++17 [[fallthrough]] attribute Date: Mon, 16 Oct 2023 17:02:40 -0600 Message-ID: <20231016230527.1820819-2-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeO-003Maa-2N X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNO6W1J43FG3QH5KfYBKAsPqVpt/uuRThfBVTCxxOOfpJQyRc1oz5bW3vb3HvAkYQTEKo3DmGxUnPH8Flj/en5v99D5BNRQD5y+O/5ijXkrrqkeVTbGB qU8vxSUr4mf1dR6VMLarTGUqWWtG5BkoQKgncYh+UpQ3Pk1nAn1qo4ChOnz/Eebbv3J/wxxL39V7s6r6swor/avL8yxrwSgkWzQ= X-Spam-Status: No, score=-3024.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This changes gdb to use the C++17 [[fallthrough]] attribute rather than special comments. This was mostly done by script, but I neglected a few spellings and so also fixed it up by hand. I suspect this fixes the bug mentioned below, by switching to a standard approach that, presumably, clang supports. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23159 --- gdb/aarch64-tdep.c | 2 +- gdb/ada-exp.y | 2 +- gdb/ada-lang.c | 2 +- gdb/ada-valprint.c | 2 +- gdb/amd64-windows-tdep.c | 2 +- gdb/arch/arm.c | 2 +- gdb/arm-tdep.c | 2 +- gdb/c-exp.y | 6 ++-- gdb/cli/cli-setshow.c | 2 +- gdb/coffread.c | 4 +-- gdb/compile/compile-c-support.c | 2 +- gdb/compile/compile-c-symbols.c | 2 +- gdb/compile/compile-cplus-symbols.c | 2 +- gdb/cp-name-parser.y | 4 +-- gdb/cp-support.c | 2 +- gdb/ctfread.c | 2 +- gdb/d-exp.y | 4 +-- gdb/d-valprint.c | 2 +- gdb/dbxread.c | 2 +- gdb/disasm-selftests.c | 2 +- gdb/dwarf2/macro.c | 4 +-- gdb/dwarf2/read.c | 22 ++++++------ gdb/eval.c | 2 +- gdb/f-exp.y | 4 +-- gdb/fbsd-nat.c | 2 +- gdb/gdbtypes.c | 10 +++--- gdb/go-exp.y | 4 +-- gdb/go-valprint.c | 2 +- gdb/i386-tdep.c | 8 ++--- gdb/m2-typeprint.c | 2 +- gdb/m2-valprint.c | 4 +-- gdb/machoread.c | 2 +- gdb/mdebugread.c | 6 ++-- gdb/mi/mi-cmd-stack.c | 2 +- gdb/minsyms.c | 2 +- gdb/mips-tdep.c | 6 ++-- gdb/msp430-tdep.c | 2 +- gdb/nat/linux-btrace.c | 3 +- gdb/nat/windows-nat.c | 4 +-- gdb/nat/x86-dregs.c | 2 +- gdb/p-exp.y | 2 +- gdb/p-valprint.c | 2 +- gdb/printcmd.c | 2 +- gdb/record-btrace.c | 2 +- gdb/remote.c | 6 ++-- gdb/riscv-tdep.c | 2 +- gdb/rs6000-tdep.c | 52 ++++++++++++++--------------- gdb/rust-parse.c | 4 +-- gdb/s390-tdep.c | 28 ++++++++-------- gdb/stabsread.c | 6 ++-- gdb/symfile.c | 2 +- gdb/utils.c | 2 +- gdb/valops.c | 6 ++-- gdb/value.c | 2 +- gdb/windows-nat.c | 4 +-- gdb/xcoffread.c | 4 +-- gdb/z80-tdep.c | 2 +- gdbserver/netbsd-low.cc | 2 +- gdbsupport/btrace-common.cc | 6 ++-- gdbsupport/format.cc | 4 +-- 60 files changed, 140 insertions(+), 143 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index eaae2d91047..ba37b4969a3 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -1851,7 +1851,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache, if (arg_type->is_vector ()) return pass_in_v (gdbarch, regcache, info, arg_type->length (), arg->contents ().data ()); - /* fall through. */ + [[fallthrough]]; case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 3280a483a5e..fcb5aa4379b 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1307,7 +1307,7 @@ write_object_renaming (struct parser_state *par_state, break; case 'L': slice_state = LOWER_BOUND; - /* FALLTHROUGH */ + [[fallthrough]]; case 'S': renaming_expr += 1; if (isdigit (*renaming_expr)) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index ff7222c7eed..1a591567cda 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5508,7 +5508,7 @@ compare_names_with_case (const char *string1, const char *string2, else return 1; } - /* FALLTHROUGH */ + [[fallthrough]]; default: if (*string2 == '(') return strcmp_iw_ordered (string1, string2); diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index f1c4e8b0b70..0930df81061 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -89,7 +89,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type, break; case TYPE_CODE_UNDEF: index_type = NULL; - /* FALL THROUGH */ + [[fallthrough]]; default: if (low_bound == 1) return 0; diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 9d69ec282d2..6be43434121 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -380,7 +380,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, break; } } - /* fall through */ + [[fallthrough]]; default: /* All other values that are 1, 2, 4 or 8 bytes long are returned via RAX. */ diff --git a/gdb/arch/arm.c b/gdb/arch/arm.c index 4720c201c53..6fc4c0e11cd 100644 --- a/gdb/arch/arm.c +++ b/gdb/arch/arm.c @@ -153,7 +153,7 @@ arm_instruction_changes_pc (uint32_t this_instr) return 0; } /* Data processing instruction. */ - /* Fall through. */ + [[fallthrough]]; case 0x1: if (bits (this_instr, 12, 15) == 15) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 58c550af183..66e258199d7 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -7600,7 +7600,7 @@ arm_decode_miscellaneous (struct gdbarch *gdbarch, uint32_t insn, else if (op == 0x3) /* Not really supported. */ return arm_copy_unmodified (gdbarch, insn, "smc", dsc); - /* Fall through. */ + [[fallthrough]]; default: return arm_copy_undef (gdbarch, insn, dsc); diff --git a/gdb/c-exp.y b/gdb/c-exp.y index a27dbfa608f..2b4c21850d3 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -2731,7 +2731,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name) last_was_structop = true; goto symbol; /* Nope, must be a symbol. */ } - /* FALL THRU. */ + [[fallthrough]]; case '0': case '1': @@ -2828,7 +2828,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name) return ENTRY; } } - /* FALLTHRU */ + [[fallthrough]]; case '+': case '-': case '*': @@ -2855,7 +2855,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name) case 'U': if (tokstart[1] != '"' && tokstart[1] != '\'') break; - /* Fall through. */ + [[fallthrough]]; case '\'': case '"': diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index c7bbac1666d..11f93068b68 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -379,7 +379,7 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c) case var_filename: if (*arg == '\0') error_no_arg (_("filename to set it to.")); - /* FALLTHROUGH */ + [[fallthrough]]; case var_optional_filename: { char *val = NULL; diff --git a/gdb/coffread.c b/gdb/coffread.c index 4a6a83b15ad..256d6335468 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -914,7 +914,7 @@ coff_symtab_read (minimal_symbol_reader &reader, backtraces, so filter them out (from phdm@macqel.be). */ if (within_function) break; - /* Fall through. */ + [[fallthrough]]; case C_STAT: case C_THUMBLABEL: case C_THUMBSTAT: @@ -952,7 +952,7 @@ coff_symtab_read (minimal_symbol_reader &reader, that look like this. Ignore them. */ break; /* For static symbols that don't start with '.'... */ - /* Fall through. */ + [[fallthrough]]; case C_THUMBEXT: case C_THUMBEXTFUNC: case C_EXT: diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c index 20a7bb4e0d4..46318dba1b2 100644 --- a/gdb/compile/compile-c-support.c +++ b/gdb/compile/compile-c-support.c @@ -268,7 +268,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch, } } - /* Fall through. */ + [[fallthrough]]; default: gdb_printf (stream, diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c index 5982178170c..a80b9a43156 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -136,7 +136,7 @@ convert_one_symbol (compile_c_instance *context, "be referenced from the current thread in " "compiled code."), sym.symbol->print_name ()); - /* FALLTHROUGH */ + [[fallthrough]]; case LOC_UNRESOLVED: /* 'symbol_name' cannot be used here as that one is used only for local variables from compile_dwarf_expr_to_c. diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c index 1edbf8f64b5..5cffe5cfebb 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -132,7 +132,7 @@ convert_one_symbol (compile_cplus_instance *instance, "be referenced from the current thread in " "compiled code."), sym.symbol->print_name ()); - /* FALLTHROUGH */ + [[fallthrough]]; case LOC_UNRESOLVED: /* 'symbol_name' cannot be used here as that one is used only for local variables from compile_dwarf_expr_to_c. diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index 061882363be..4f407f504ef 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -1605,7 +1605,7 @@ yylex (YYSTYPE *lvalp, cpname_state *state) sizeof "(anonymous namespace)" - 1); return NAME; } - /* FALL THROUGH */ + [[fallthrough]]; case ')': case ',': @@ -1642,7 +1642,7 @@ yylex (YYSTYPE *lvalp, cpname_state *state) state->lexptr++; return '-'; } - /* FALL THRU. */ + [[fallthrough]]; try_number: case '0': diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 882acfb62a2..085d7c976e2 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -532,7 +532,7 @@ replace_typedefs (struct demangle_parse_info *info, { case DEMANGLE_COMPONENT_ARGLIST: check_cv_qualifiers (ret_comp); - /* Fall through */ + [[fallthrough]]; case DEMANGLE_COMPONENT_FUNCTION_TYPE: case DEMANGLE_COMPONENT_TEMPLATE: diff --git a/gdb/ctfread.c b/gdb/ctfread.c index c74ec044c18..03a042ec38c 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -1473,7 +1473,7 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg) { case CTF_K_ENUM: ctf_psymtab_add_enums (ccp, tid); - /* FALL THROUGH */ + [[fallthrough]]; case CTF_K_STRUCT: case CTF_K_UNION: domain = STRUCT_DOMAIN; diff --git a/gdb/d-exp.y b/gdb/d-exp.y index 6c5569a1c8d..e2507982d50 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -1103,7 +1103,7 @@ lex_one_token (struct parser_state *par_state) last_was_structop = 1; goto symbol; /* Nope, must be a symbol. */ } - /* FALL THRU. */ + [[fallthrough]]; case '0': case '1': @@ -1180,7 +1180,7 @@ lex_one_token (struct parser_state *par_state) return ENTRY; } } - /* FALLTHRU */ + [[fallthrough]]; case '+': case '-': case '*': diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c index 38fb2a07c1f..4c3ea227750 100644 --- a/gdb/d-valprint.c +++ b/gdb/d-valprint.c @@ -85,7 +85,7 @@ d_value_print_inner (struct value *val, struct ui_file *stream, int recurse, stream, recurse, val, options); if (ret == 0) break; - /* Fall through. */ + [[fallthrough]]; default: c_value_print_inner (val, stream, recurse, options); break; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index b92193bdadd..99d9fba96ea 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2806,7 +2806,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name, case N_NBSTS: case N_NBLCS: unknown_symtype_complaint (hex_string (type)); - /* FALLTHROUGH */ + [[fallthrough]]; define_a_symbol: /* These symbol types don't need the address field relocated, diff --git a/gdb/disasm-selftests.c b/gdb/disasm-selftests.c index 0cf766a48b7..200d33aff4e 100644 --- a/gdb/disasm-selftests.c +++ b/gdb/disasm-selftests.c @@ -126,7 +126,7 @@ get_test_insn (struct gdbarch *gdbarch, size_t *len) if (info->bits_per_address > sizeof (bfd_vma) * CHAR_BIT) return insn; } - /* fall through */ + [[fallthrough]]; default: generic_case: { diff --git a/gdb/dwarf2/macro.c b/gdb/dwarf2/macro.c index 2e88e670216..7d86d16d0e3 100644 --- a/gdb/dwarf2/macro.c +++ b/gdb/dwarf2/macro.c @@ -784,7 +784,7 @@ dwarf_decode_macro_bytes (dwarf2_per_objfile *per_objfile, /* We don't recognize any vendor extensions. */ break; } - /* FALLTHROUGH */ + [[fallthrough]]; default: mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions, @@ -939,7 +939,7 @@ dwarf_decode_macros (dwarf2_per_objfile *per_objfile, read_direct_string (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; } - /* FALLTHROUGH */ + [[fallthrough]]; default: mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions, diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index a2c1428b0f4..665912aa845 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -6667,7 +6667,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) && die->parent != NULL && die->parent->tag == DW_TAG_subprogram) cu->processing_has_namespace_info = true; - /* Fall through. */ + [[fallthrough]]; case DW_TAG_inlined_subroutine: read_func_scope (die, cu); break; @@ -6709,7 +6709,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) instead. */ if (cu->lang () != language_ada) break; - /* FALLTHROUGH */ + [[fallthrough]]; case DW_TAG_base_type: case DW_TAG_subrange_type: case DW_TAG_generic_subrange: @@ -6737,7 +6737,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) break; /* The declaration is neither a global namespace nor a variable alias. */ - /* Fall through. */ + [[fallthrough]]; case DW_TAG_imported_module: cu->processing_has_namespace_info = true; if (die->child != NULL && (die->tag == DW_TAG_imported_declaration @@ -16627,7 +16627,7 @@ cooked_indexer::index_dies (cutu_reader *reader, case DW_TAG_module: if (this_entry == nullptr) break; - /* FALLTHROUGH */ + [[fallthrough]]; case DW_TAG_namespace: /* We don't check THIS_ENTRY for a namespace, to handle the ancient G++ workaround pointed out above. */ @@ -17334,7 +17334,7 @@ read_attribute_value (const struct die_reader_specs *reader, info_ptr += bytes_read; break; } - /* FALLTHROUGH */ + [[fallthrough]]; case DW_FORM_line_strp: if (!cu->per_cu->is_dwz) { @@ -17344,7 +17344,7 @@ read_attribute_value (const struct die_reader_specs *reader, info_ptr += bytes_read; break; } - /* FALLTHROUGH */ + [[fallthrough]]; case DW_FORM_GNU_strp_alt: { dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd, true); @@ -19157,7 +19157,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, break; case DW_TAG_template_value_param: suppress_add = 1; - /* Fall through. */ + [[fallthrough]]; case DW_TAG_constant: case DW_TAG_variable: case DW_TAG_member: @@ -19334,7 +19334,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, break; case DW_TAG_template_type_param: suppress_add = 1; - /* Fall through. */ + [[fallthrough]]; case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: @@ -19389,7 +19389,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, case DW_TAG_unspecified_type: if (cu->lang () == language_ada) break; - /* FALLTHROUGH */ + [[fallthrough]]; case DW_TAG_typedef: case DW_TAG_array_type: case DW_TAG_base_type: @@ -20186,7 +20186,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) return parent_type->name (); return ""; } - /* Fall through. */ + [[fallthrough]]; default: return determine_prefix (parent, cu); } @@ -20370,7 +20370,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_template_value_param: if (attr_name == nullptr) return unnamed_template_tag_name (die, cu); - /* FALLTHROUGH. */ + [[fallthrough]]; case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: diff --git a/gdb/eval.c b/gdb/eval.c index 3358b0d8d32..8192aeba364 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -172,7 +172,7 @@ fetch_subexp_value (struct expression *exp, case MEMORY_ERROR: if (!preserve_errors) break; - /* Fall through. */ + [[fallthrough]]; default: throw; break; diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 18566afd67f..e4e2171d641 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -1503,7 +1503,7 @@ yylex (void) /* Might be a floating point number. */ if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9') goto symbol; /* Nope, must be a symbol. */ - /* FALL THRU. */ + [[fallthrough]]; case '0': case '1': @@ -1571,7 +1571,7 @@ yylex (void) case '%': last_was_structop = true; - /* Fall through. */ + [[fallthrough]]; case '+': case '-': case '*': diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 211b83f555a..b56e194b7d5 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -1641,7 +1641,7 @@ fbsd_nat_target::stop_process (inferior *inf) if (status.sig () == GDB_SIGNAL_STOP) break; - /* FALLTHROUGH */ + [[fallthrough]]; default: /* Some other event has occurred. Save the current event. */ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 284793c055d..e310648d410 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1102,7 +1102,7 @@ get_discrete_low_bound (struct type *type) if (!type->is_unsigned ()) return -(1 << (type->length () * TARGET_CHAR_BIT - 1)); - /* fall through */ + [[fallthrough]]; case TYPE_CODE_CHAR: return 0; @@ -1172,7 +1172,7 @@ get_discrete_high_bound (struct type *type) return -low - 1; } - /* fall through */ + [[fallthrough]]; case TYPE_CODE_CHAR: { /* This round-about calculation is to avoid shifting by @@ -4437,7 +4437,7 @@ rank_one_type_parm_ptr (struct type *parm, struct type *arg, struct value *value return NS_INTEGER_POINTER_CONVERSION_BADNESS; } } - /* fall through */ + [[fallthrough]]; case TYPE_CODE_ENUM: case TYPE_CODE_FLAGS: case TYPE_CODE_CHAR: @@ -4609,7 +4609,7 @@ rank_one_type_parm_char (struct type *parm, struct type *arg, struct value *valu return INTEGER_CONVERSION_BADNESS; else if (arg->length () < parm->length ()) return INTEGER_PROMOTION_BADNESS; - /* fall through */ + [[fallthrough]]; case TYPE_CODE_CHAR: /* Deal with signed, unsigned, and plain chars for C++ and with int cases falling through from previous case. */ @@ -4742,7 +4742,7 @@ rank_one_type_parm_struct (struct type *parm, struct type *arg, struct value *va rank.subrank = distance_to_ancestor (parm, arg, 0); if (rank.subrank >= 0) return sum_ranks (BASE_CONVERSION_BADNESS, rank); - /* fall through */ + [[fallthrough]]; default: return INCOMPATIBLE_TYPE_BADNESS; } diff --git a/gdb/go-exp.y b/gdb/go-exp.y index 28bf3f0ab33..c9b9c0b1ab7 100644 --- a/gdb/go-exp.y +++ b/gdb/go-exp.y @@ -1054,7 +1054,7 @@ lex_one_token (struct parser_state *par_state) last_was_structop = 1; goto symbol; /* Nope, must be a symbol. */ } - /* FALL THRU. */ + [[fallthrough]]; case '0': case '1': @@ -1129,7 +1129,7 @@ lex_one_token (struct parser_state *par_state) return ENTRY; } } - /* FALLTHRU */ + [[fallthrough]]; case '+': case '-': case '*': diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c index 05788af15a6..ca1e6b5ba6f 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -114,7 +114,7 @@ go_language::value_print_inner (struct value *val, struct ui_file *stream, break; } } - /* Fall through. */ + [[fallthrough]]; default: c_value_print_inner (val, stream, recurse, options); diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 560f16aa0e3..12b98d6f20d 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -6011,7 +6011,7 @@ Do you want to stop the program?"), ir.addr -= 1; goto no_support; } - /* FALLTHROUGH */ + [[fallthrough]]; case 0x0fb2: /* lss Gv */ case 0x0fb4: /* lfs Gv */ case 0x0fb5: /* lgs Gv */ @@ -6248,7 +6248,7 @@ Do you want to stop the program?"), I386_SAVE_FPU_REGS)) return -1; } - /* Fall through */ + [[fallthrough]]; default: if (record_full_arch_list_add_mem (addr64, 2)) return -1; @@ -6787,7 +6787,7 @@ Do you want to stop the program?"), ir.addr -= 1; goto no_support; } - /* FALLTHROUGH */ + [[fallthrough]]; case 0xf5: /* cmc */ case 0xf8: /* clc */ case 0xf9: /* stc */ @@ -7229,7 +7229,7 @@ Do you want to stop the program?"), else if (ir.rm == 1) break; } - /* Fall through. */ + [[fallthrough]]; case 3: /* lidt */ if (ir.mod == 3) { diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 72f978205ab..179c3fccc30 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -389,7 +389,7 @@ m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) return 0; } } - /* fall through */ + [[fallthrough]]; default: return get_discrete_bounds (type, lowp, highp); } diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index 96a566fb810..c4570da2e18 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -373,7 +373,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream, gdb_printf (stream, "{...}"); break; } - /* Fall through. */ + [[fallthrough]]; case TYPE_CODE_STRUCT: if (m2_is_long_set (type)) m2_print_long_set (type, valaddr, 0, address, stream); @@ -451,7 +451,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream, value_print_inner (v, stream, recurse, options); break; } - /* FALLTHROUGH */ + [[fallthrough]]; case TYPE_CODE_REF: case TYPE_CODE_ENUM: diff --git a/gdb/machoread.c b/gdb/machoread.c index 38c252c2861..87d30ec8587 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -292,7 +292,7 @@ macho_symtab_read (minimal_symbol_reader &reader, case N_FUN: if (sym->name == NULL || sym->name[0] == 0) break; - /* Fall through. */ + [[fallthrough]]; case N_STSYM: /* Interesting symbol. */ nbr_syms++; diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index fc731605991..a28005031e6 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2582,7 +2582,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, those too. */ if (name[0] == '.') continue; - /* Fall through. */ + [[fallthrough]]; default: ms_type = mst_unknown; unknown_ext_complaint (name); @@ -3430,7 +3430,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, mst_file_text, SECT_OFF_TEXT (objfile)); - /* FALLTHROUGH */ + [[fallthrough]]; case stProc: /* Ignore all parameter symbol records. */ @@ -3666,7 +3666,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, default: unknown_ext_complaint (debug_info->ssext + psh->iss); /* Pretend it's global. */ - /* Fall through. */ + [[fallthrough]]; case stGlobal: /* Global common symbols are resolved by the runtime loader, ignore them. */ diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 6982338751a..401e7c40726 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -652,7 +652,7 @@ list_args_or_locals (const frame_print_options &fp_opts, case PRINT_SIMPLE_VALUES: if (!mi_simple_type_p (sym2->type ())) break; - /* FALLTHROUGH */ + [[fallthrough]]; case PRINT_ALL_VALUES: if (sym->is_argument ()) diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 72e500be959..71e22ce1a90 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -140,7 +140,7 @@ msymbol_is_function (struct objfile *objfile, minimal_symbol *minsym, /* Ignore function symbol that is not a function entry. */ if (msymbol_is_cold_clone (minsym)) return false; - /* fallthru */ + [[fallthrough]]; default: if (func_address_p != NULL) *func_address_p = msym_addr; diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index d40d28e85de..17bc9db6b89 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -3992,7 +3992,7 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) && (itype_rt (insn) & 0x2) == 0); if (is_branch) /* BC1ANY2F, BC1ANY2T, BC1ANY4F, BC1ANY4T */ break; - /* Fall through. */ + [[fallthrough]]; case 18: /* COP2 */ case 19: /* COP3 */ is_branch = (itype_rs (insn) == 8); /* BCzF, BCzFL, BCzT, BCzTL */ @@ -4100,7 +4100,7 @@ micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch, || (insn & 0x3) != 0x1)) /* BC1ANY*: bits 010000 111xx xxx01 */ break; - /* Fall through. */ + [[fallthrough]]; case 0x25: /* BEQ: bits 100101 */ case 0x2d: /* BNE: bits 101101 */ @@ -4122,7 +4122,7 @@ micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch, /* JALR, JALR.HB: 000000 000x111100 111100 */ /* JALRS, JALRS.HB: 000000 010x111100 111100 */ break; - /* Fall through. */ + [[fallthrough]]; case 0x1d: /* JALS: bits 011101 */ case 0x35: /* J: bits 110101 */ diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index 97d9073efbb..f65948f01d8 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -886,7 +886,7 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; } } - /* Fall through. */ + [[fallthrough]]; default: error (_("Unknown msp430 isa")); break; diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c index aa02f193399..3215c4a7410 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -896,8 +896,7 @@ linux_read_pt (btrace_data_pt *btrace, linux_btrace_target_info *tinfo, case BTRACE_READ_NEW: if (!perf_event_new_data (&tinfo->pev)) return BTRACE_ERR_NONE; - - /* Fall through. */ + [[fallthrough]]; case BTRACE_READ_ALL: perf_event_read_all (&tinfo->pev, &btrace->data, &btrace->size); return BTRACE_ERR_NONE; diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index bf4c4387886..3066ff96a19 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -456,7 +456,7 @@ windows_process_info::handle_exception (struct target_waitstatus *ourstatus, break; } #endif - /* FALLTHROUGH */ + [[fallthrough]]; case STATUS_WX86_BREAKPOINT: DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT"); ourstatus->set_stopped (GDB_SIGNAL_TRAP); @@ -495,7 +495,7 @@ windows_process_info::handle_exception (struct target_waitstatus *ourstatus, break; } /* treat improperly formed exception as unknown */ - /* FALLTHROUGH */ + [[fallthrough]]; default: /* Treat unhandled first chance exceptions specially. */ if (current_event.u.Exception.dwFirstChance) diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c index 731093dfa73..16669f69657 100644 --- a/gdb/nat/x86-dregs.c +++ b/gdb/nat/x86-dregs.c @@ -289,7 +289,7 @@ Invalid hardware breakpoint type %d in x86_length_and_rw_bits.\n"), case 8: if (TARGET_HAS_DR_LEN_8) return (DR_LEN_8 | rw); - /* FALL THROUGH */ + [[fallthrough]]; default: internal_error (_("\ Invalid hardware breakpoint length %d in x86_length_and_rw_bits.\n"), len); diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 2360a500476..b0f334897ad 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -1159,7 +1159,7 @@ yylex (void) goto symbol; /* Nope, must be a symbol. */ } - /* FALL THRU. */ + [[fallthrough]]; case '0': case '1': diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index fb9386293a6..678df5eee0d 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -298,7 +298,7 @@ pascal_language::value_print_inner (struct value *val, gdb_printf (stream, "{...}"); break; } - /* Fall through. */ + [[fallthrough]]; case TYPE_CODE_STRUCT: if (options->vtblprint && pascal_object_is_vtbl_ptr_type (type)) { diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 5afbc565cf7..f0be4268e60 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -482,7 +482,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, byte_order); break; } - /* FALLTHROUGH */ + [[fallthrough]]; case 'f': print_floating (valaddr, type, stream); break; diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 7a7d7617bc9..5aa8c096c6e 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -231,7 +231,7 @@ record_btrace_get_cpu (void) case CS_NONE: record_btrace_cpu.vendor = CV_UNKNOWN; - /* Fall through. */ + [[fallthrough]]; case CS_CPU: return &record_btrace_cpu; } diff --git a/gdb/remote.c b/gdb/remote.c index b405cb6abf7..3e90964f027 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -7985,7 +7985,7 @@ Packet: '%s'\n"), if (event->ws.kind () != TARGET_WAITKIND_IGNORE) break; - /* fall through */ + [[fallthrough]]; case 'S': /* Old style status, just signal only. */ { int sig; @@ -8502,7 +8502,7 @@ remote_target::wait_as (ptid_t ptid, target_waitstatus *status, putpkt (buf); break; } - /* fallthrough */ + [[fallthrough]]; default: warning (_("Invalid remote reply: %s"), buf); break; @@ -9844,7 +9844,7 @@ remote_target::putpkt_binary (const char *buf, int cnt) return 1; case '-': remote_debug_printf_nofunc ("Received Nak"); - /* FALLTHROUGH */ + [[fallthrough]]; case SERIAL_TIMEOUT: tcount++; if (tcount > 3) diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 3725be44276..8849483d4d4 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -3183,7 +3183,7 @@ riscv_arg_location (struct gdbarch *gdbarch, riscv_call_arg_struct (ainfo, cinfo); break; } - /* FALLTHROUGH */ + [[fallthrough]]; default: riscv_call_arg_scalar_int (ainfo, cinfo); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index bae6737852d..355268dca42 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -4247,7 +4247,7 @@ ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache, case 39: /* Vector Multiply-Sum Unsigned Halfword Saturate */ case 41: /* Vector Multiply-Sum Signed Halfword Saturate */ record_full_arch_list_add_reg (regcache, PPC_VSCR_REGNUM); - /* FALL-THROUGH */ + [[fallthrough]]; case 20: /* Move To VSR Byte Mask Immediate opcode, b2 = 0, ignore bit 31 */ case 21: /* Move To VSR Byte Mask Immediate opcode, b2 = 1, @@ -4313,7 +4313,7 @@ ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache, && vra != 7 /* Decimal Convert From National */ && vra != 31) /* Decimal Set Sign */ break; - /* Fall through. */ + [[fallthrough]]; /* 5.16 Decimal Integer Arithmetic Instructions */ case 1: /* Decimal Add Modulo */ case 65: /* Decimal Subtract Modulo */ @@ -4502,7 +4502,7 @@ ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache, case 970: /* Vector Convert To Signed Fixed-Point Word Saturate */ case 906: /* Vector Convert To Unsigned Fixed-Point Word Saturate */ record_full_arch_list_add_reg (regcache, PPC_VSCR_REGNUM); - /* FALL-THROUGH */ + [[fallthrough]]; case 12: /* Vector Merge High Byte */ case 14: /* Vector Pack Unsigned Halfword Unsigned Modulo */ case 76: /* Vector Merge High Halfword */ @@ -4835,7 +4835,7 @@ ppc_process_record_op19 (struct gdbarch *gdbarch, struct regcache *regcache, case 560: /* Branch Conditional to Branch Target Address Register */ if ((PPC_BO (insn) & 0x4) == 0) record_full_arch_list_add_reg (regcache, tdep->ppc_ctr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 528: /* Branch Conditional to Count Register */ if (PPC_LK (insn)) record_full_arch_list_add_reg (regcache, tdep->ppc_lr_regnum); @@ -4926,7 +4926,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, case 491: /* Divide Word */ if (PPC_OE (insn)) record_full_arch_list_add_reg (regcache, tdep->ppc_xer_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 9: /* Multiply High Doubleword Unsigned */ case 11: /* Multiply High Word Unsigned */ case 73: /* Multiply High Doubleword */ @@ -5018,7 +5018,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, record_full_arch_list_add_reg (regcache, tdep->ppc_xer_regnum); record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 0: /* Compare */ case 32: /* Compare logical */ case 144: /* Move To Condition Register Fields */ @@ -5041,7 +5041,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, case 373: /* Load Word Algebraic with Update Indexed */ record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 21: /* Load Doubleword Indexed */ case 52: /* Load Byte And Reserve Indexed */ case 116: /* Load Halfword And Reserve Indexed */ @@ -5114,7 +5114,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, case 631: /* Load Floating-Point Double with Update Indexed */ record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 535: /* Load Floating-Point Single Indexed */ case 599: /* Load Floating-Point Double Indexed */ case 855: /* Load Floating-Point as Integer Word Algebraic Indexed */ @@ -5210,7 +5210,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, case 759: /* Store Floating-Point Double with Update Indexed */ record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 135: /* Store Vector Element Byte Indexed */ case 167: /* Store Vector Element Halfword Indexed */ case 199: /* Store Vector Element Word Indexed */ @@ -5504,7 +5504,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, case 878: /* Transaction Abort Doubleword Conditional Immediate */ case 910: /* Transaction Abort */ record_full_arch_list_add_reg (regcache, tdep->ppc_ps_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 718: /* Transaction Check */ record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum); return 0; @@ -5728,7 +5728,7 @@ ppc_process_record_op60_XX2 (struct gdbarch *gdbarch, case 24: /* VSX Vector Convert Half-Precision format to Single-Precision format */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* Fall-through */ + [[fallthrough]]; case 0: /* VSX Vector Extract Exponent Double-Precision */ case 1: /* VSX Vector Extract Significand Double-Precision */ case 7: /* VSX Vector Byte-Reverse Halfword */ @@ -5822,7 +5822,7 @@ ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache, case 19: /* VSX Scalar Compare Greater Than or Equal Double-Precision */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 240: /* VSX Vector Copy Sign Double-Precision */ case 208: /* VSX Vector Copy Sign Single-Precision */ case 130: /* VSX Logical AND */ @@ -6009,7 +6009,7 @@ ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache, case 203: /* VSX Vector Square Root Double-Precision */ case 139: /* VSX Vector Square Root Single-Precision */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 345: /* VSX Scalar Absolute Value Double-Precision */ case 267: /* VSX Scalar Convert Scalar Single-Precision to Vector Single-Precision format Non-signalling */ @@ -6032,7 +6032,7 @@ ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache, case 298: /* VSX Scalar Test Data Class Single-Precision */ case 362: /* VSX Scalar Test Data Class Double-Precision */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 106: /* VSX Scalar Test for software Square Root Double-Precision */ case 234: /* VSX Vector Test for software Square Root @@ -6304,7 +6304,7 @@ ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache, case 22: /* Move From FPSCR Control & set RN */ case 23: /* Move From FPSCR Control & set RN Immediate */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* Fall through. */ + [[fallthrough]]; case 0: /* Move From FPSCR */ case 24: /* Move From FPSCR Lightweight */ if (PPC_FIELD (insn, 11, 5) == 0 && PPC_RC (insn)) @@ -6350,7 +6350,7 @@ ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache, case 644: /* VSX Scalar Compare Unordered Quad-Precision */ case 708: /* VSX Scalar Test Data Class Quad-Precision */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 128: /* Floating Test for software Divide */ case 160: /* Floating Test for software Square Root */ record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum); @@ -6387,7 +6387,7 @@ ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache, } record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 68: /* VSX Scalar Compare Equal Quad-Precision */ case 196: /* VSX Scalar Compare Greater Than or Equal Quad-Precision */ @@ -6395,7 +6395,7 @@ ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache, case 676: /* VSX Scalar Maximum Type-C Quad-Precision */ case 740: /* VSX Scalar Minimum Type-C Quad-Precision */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 100: /* VSX Scalar Copy Sign Quad-Precision */ case 868: /* VSX Scalar Insert Exponent Quad-Precision */ ppc_record_vsr (regcache, tdep, PPC_VRT (insn) + 32); @@ -6406,7 +6406,7 @@ ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache, { case 27: /* VSX Scalar Square Root Quad-Precision */ record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 0: /* VSX Scalar Absolute Quad-Precision */ case 2: /* VSX Scalar Extract Exponent Quad-Precision */ case 8: /* VSX Scalar Negative Absolute Quad-Precision */ @@ -7171,10 +7171,10 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, case 13: /* Add Immediate Carrying and Record */ record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 12: /* Add Immediate Carrying */ record_full_arch_list_add_reg (regcache, tdep->ppc_xer_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 14: /* Add Immediate */ case 15: /* Add Immediate Shifted */ record_full_arch_list_add_reg (regcache, @@ -7184,7 +7184,7 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, case 16: /* Branch Conditional */ if ((PPC_BO (insn) & 0x4) == 0) record_full_arch_list_add_reg (regcache, tdep->ppc_ctr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 18: /* Branch */ if (PPC_LK (insn)) record_full_arch_list_add_reg (regcache, tdep->ppc_lr_regnum); @@ -7213,7 +7213,7 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, case 28: /* AND Immediate */ case 29: /* AND Immediate Shifted */ record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum); - /* FALL-THROUGH */ + [[fallthrough]]; case 24: /* OR Immediate */ case 25: /* OR Immediate Shifted */ case 26: /* XOR Immediate */ @@ -7233,7 +7233,7 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, case 43: /* Load Halfword Algebraic with Update */ record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 32: /* Load Word and Zero */ case 34: /* Load Byte and Zero */ case 40: /* Load Halfword and Zero */ @@ -7257,7 +7257,7 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, case 51: /* Load Floating-Point Double with Update */ record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 48: /* Load Floating-Point Single */ case 50: /* Load Floating-Point Double */ record_full_arch_list_add_reg (regcache, @@ -7285,7 +7285,7 @@ ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache, case 55: /* Store Floating-Point Double with Update */ record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn)); - /* FALL-THROUGH */ + [[fallthrough]]; case 36: /* Store Word */ case 38: /* Store Byte */ case 44: /* Store Halfword */ diff --git a/gdb/rust-parse.c b/gdb/rust-parse.c index d2f6008026f..aaf4cef0d7e 100644 --- a/gdb/rust-parse.c +++ b/gdb/rust-parse.c @@ -1386,7 +1386,7 @@ rust_parser::parse_binop (bool required) case COMPOUND_ASSIGN: compound_assign_op = current_opcode; - /* FALLTHROUGH */ + [[fallthrough]]; case '=': precedence = ASSIGN_PREC; lex (); @@ -1831,7 +1831,7 @@ rust_parser::parse_path (bool for_expr) if (current_token != COLONCOLON) return "self"; lex (); - /* FALLTHROUGH */ + [[fallthrough]]; case KW_SUPER: while (current_token == KW_SUPER) { diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 54b5c89e5e3..5b58cb382e3 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -4376,7 +4376,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, break; } /* For other instructions... */ - /* Fall through. */ + [[fallthrough]]; default: gdb_printf (gdb_stdlog, "Warning: Unknown KM* function %02x at %s.\n", (int)tmp, paddress (gdbarch, addr)); @@ -4685,7 +4685,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, break; } /* For KLMD... */ - /* Fall through. */ + [[fallthrough]]; default: gdb_printf (gdb_stdlog, "Warning: Unknown KMAC function %02x at %s.\n", (int)tmp, paddress (gdbarch, addr)); @@ -6542,7 +6542,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, /* op3c */ if (record_full_arch_list_add_reg (regcache, S390_R0_REGNUM + inib[3])) return -1; - /* fallthru */ + [[fallthrough]]; case 0x0c: /* CSST */ /* op4 */ if (record_full_arch_list_add_mem (oaddr2, 4)) @@ -6557,7 +6557,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 4)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x10: /* CSDST */ /* op6 */ if (target_read_memory (oaddr2 + 0x68, buf, 8)) @@ -6573,7 +6573,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 4)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x04: /* CS */ CS: /* op1c */ @@ -6598,7 +6598,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 8)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x11: /* CSDSTG */ /* op6 */ if (target_read_memory (oaddr2 + 0x68, buf, 8)) @@ -6607,7 +6607,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 8)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x0d: /* CSSTG */ CSSTG: /* op4 */ @@ -6617,7 +6617,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 8)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x05: /* CSG */ /* op1c */ if (record_full_arch_list_add_mem (oaddr2 + 0x08, 8)) @@ -6631,7 +6631,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, /* op3c */ if (s390_record_gpr_g (gdbarch, regcache, inib[3])) return -1; - /* fallthru */ + [[fallthrough]]; case 0x0e: /* CSSTGR */ /* op4 */ if (record_full_arch_list_add_mem (oaddr2, 8)) @@ -6646,7 +6646,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 8)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x12: /* CSDSTGR */ /* op6 */ if (target_read_memory (oaddr2 + 0x68, buf, 8)) @@ -6662,7 +6662,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 8)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x06: /* CSGR */ CSGR: /* op1c */ @@ -6687,7 +6687,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 16)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x13: /* CSDSTX */ /* op6 */ if (target_read_memory (oaddr2 + 0x68, buf, 8)) @@ -6696,7 +6696,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 16)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x0f: /* CSSTX */ CSSTX: /* op4 */ @@ -6706,7 +6706,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, oaddr3 = s390_record_address_mask (gdbarch, regcache, oaddr3); if (record_full_arch_list_add_mem (oaddr3, 16)) return -1; - /* fallthru */ + [[fallthrough]]; case 0x07: /* CSX */ /* op1c */ if (record_full_arch_list_add_mem (oaddr2 + 0x00, 16)) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 4011475f7ac..088058030a3 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1100,7 +1100,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, } break; } - /* Fall through. */ + [[fallthrough]]; case 'P': /* acc seems to use P to declare the prototypes of functions that @@ -1111,7 +1111,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, sym->set_type (read_type (&p, objfile)); goto process_prototype_types; } - /*FALLTHROUGH */ + [[fallthrough]]; case 'R': /* Parameter which is in a register. */ @@ -2499,7 +2499,7 @@ read_member_functions (struct stab_field_info *fip, const char **pp, complaint (_("member function type missing, got '%c'"), (*pp)[-1]); /* Normal member function. */ - /* Fall through. */ + [[fallthrough]]; case '.': /* normal member function. */ diff --git a/gdb/symfile.c b/gdb/symfile.c index a6236804b08..059922b93ef 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3044,7 +3044,7 @@ section_is_mapped (struct obj_section *osect) if (osect->ovly_mapped == -1) gdbarch_overlay_update (gdbarch, osect); } - /* fall thru */ + [[fallthrough]]; case ovly_on: /* overlay debugging manual */ return osect->ovly_mapped == 1; } diff --git a/gdb/utils.c b/gdb/utils.c index 94a7cafa65b..5adbcfeb544 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -218,7 +218,7 @@ can_dump_core (enum resource_limit_kind limit_kind) case LIMIT_CUR: if (rlim.rlim_cur == 0) return 0; - /* Fall through. */ + [[fallthrough]]; case LIMIT_MAX: if (rlim.rlim_max == 0) diff --git a/gdb/valops.c b/gdb/valops.c index a8760ccf3e4..6521580a1e8 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1280,7 +1280,7 @@ value_assign (struct value *toval, struct value *fromval) break; } } - /* Fall through. */ + [[fallthrough]]; default: error (_("Left operand of assignment is not an lvalue.")); @@ -2820,7 +2820,7 @@ find_overload_match (gdb::array_view args, case where a xmethod is better than the source method, except when the xmethod match quality is non-standard. */ - /* FALLTHROUGH */ + [[fallthrough]]; case 1: /* Src method and ext method are incompatible. */ /* If ext method match is not standard, then let source method win. Otherwise, fallthrough to let xmethod win. */ @@ -2832,7 +2832,7 @@ find_overload_match (gdb::array_view args, method_match_quality = src_method_match_quality; break; } - /* FALLTHROUGH */ + [[fallthrough]]; case 2: /* Ext method is champion. */ method_oload_champ = ext_method_oload_champ; method_badness = ext_method_badness; diff --git a/gdb/value.c b/gdb/value.c index 7067ae94df0..b4da9675039 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3336,7 +3336,7 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num) { case TYPE_CODE_RANGE: num -= type->bounds ()->bias; - /* Fall through. */ + [[fallthrough]]; case TYPE_CODE_INT: case TYPE_CODE_CHAR: case TYPE_CODE_ENUM: diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index e4d50d081c9..caefebcaf48 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2286,14 +2286,14 @@ redir_open (const char *redir_string, int *inp, int *out, int *err) { case '0': fname++; - /* FALLTHROUGH */ + [[fallthrough]]; case '<': fd = inp; mode = O_RDONLY; break; case '1': case '2': fname++; - /* FALLTHROUGH */ + [[fallthrough]]; case '>': fd = (rc == '2') ? err : out; mode = O_WRONLY | O_CREAT; diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 829fc1f09c7..856fa134ed7 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1532,7 +1532,7 @@ process_xcoff_symbol (struct xcoff_symbol *cs, struct objfile *objfile) default: complaint (_("Unexpected storage class: %d"), cs->c_sclass); - /* FALLTHROUGH */ + [[fallthrough]]; case C_DECL: case C_PSYM: @@ -2359,7 +2359,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, complaint (_("Storage class %d not recognized during scan"), sclass); } - /* FALLTHROUGH */ + [[fallthrough]]; case C_FCN: /* C_FCN is .bf and .ef symbols. I think it is sufficient diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c index ae328550b06..f0cc7c0d917 100644 --- a/gdb/z80-tdep.c +++ b/gdb/z80-tdep.c @@ -799,7 +799,7 @@ z80_software_single_step (struct regcache *regcache) break; case insn_jr_cc_d: opcode &= 030; /* JR NZ,d has cc equal to 040, but others 000 */ - /* fall through */ + [[fallthrough]]; case insn_jp_cc_nn: case insn_call_cc_nn: case insn_ret_cc: diff --git a/gdbserver/netbsd-low.cc b/gdbserver/netbsd-low.cc index 4defd79eee4..10d8d280b98 100644 --- a/gdbserver/netbsd-low.cc +++ b/gdbserver/netbsd-low.cc @@ -410,7 +410,7 @@ netbsd_process_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, case TARGET_WAITKIND_THREAD_CREATED: case TARGET_WAITKIND_THREAD_EXITED: /* The core needlessly stops on these events. */ - /* FALLTHROUGH */ + [[fallthrough]]; case TARGET_WAITKIND_SPURIOUS: /* Spurious events are unhandled by the gdbserver core. */ if (ptrace (PT_CONTINUE, current_process ()->pid, (void *) 1, 0) diff --git a/gdbsupport/btrace-common.cc b/gdbsupport/btrace-common.cc index 932a11888b0..c09fd504270 100644 --- a/gdbsupport/btrace-common.cc +++ b/gdbsupport/btrace-common.cc @@ -134,8 +134,7 @@ btrace_data_append (struct btrace_data *dst, case BTRACE_FORMAT_NONE: dst->format = BTRACE_FORMAT_BTS; dst->variant.bts.blocks = new std::vector; - - /* Fall-through. */ + [[fallthrough]]; case BTRACE_FORMAT_BTS: { unsigned int blk; @@ -163,8 +162,7 @@ btrace_data_append (struct btrace_data *dst, dst->format = BTRACE_FORMAT_PT; dst->variant.pt.data = NULL; dst->variant.pt.size = 0; - - /* fall-through. */ + [[fallthrough]]; case BTRACE_FORMAT_PT: { gdb_byte *data; diff --git a/gdbsupport/format.cc b/gdbsupport/format.cc index 6e5a3cb6603..85d1f9a8905 100644 --- a/gdbsupport/format.cc +++ b/gdbsupport/format.cc @@ -257,14 +257,14 @@ format_pieces::format_pieces (const char **arg, bool gdb_extensions, case 'u': if (seen_hash) bad = 1; - /* FALLTHROUGH */ + [[fallthrough]]; case 'o': case 'x': case 'X': if (seen_space || seen_plus) bad = 1; - /* FALLTHROUGH */ + [[fallthrough]]; case 'd': case 'i': From patchwork Mon Oct 16 23:02:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77907 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DDE22385B513 for ; Mon, 16 Oct 2023 23:06:12 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 793723858C35 for ; Mon, 16 Oct 2023 23:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 793723858C35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 793723858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497535; cv=none; b=UY1yLKAdOuNyDhzPFoXLlnEevCzlRXoCL4RQIaw9I6A3lZUN8q7V7d0lNagFKw4ZTnQaYc28e8cLLTfOkv26vtgjep96kUvzq0Cc7Fi+o+h2gCedRV4aqrBeLqJeF0VgmpYCM+N5k9Kjr8jWRrO8opwjSshT121c84Q0yXePc3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497535; c=relaxed/simple; bh=Y4NQ3v/8OlZEU432dz236HeXgeKh0XesqO/JroD2pX0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=o7SCwpUl4IcUnu9eqnEYHGVAySgSYUf8abpJ/oiAHri/NPXNLn3MBqsKtYKHGshL+17Z/Xp+Yt4icZD0zEuXnssKA1gnM3snLYMhxGpxCwClB+Vl25PCVR/Xb5rEGAB8hHaRTouNkcCdOTHhrYm0BJHq0azHYAqwSM0eZZKVwgM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5010a.ext.cloudfilter.net ([10.0.29.199]) by cmsmtp with ESMTP id sVfBqTQvfMZBksWeQqCePu; Mon, 16 Oct 2023 23:05:30 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWePqu9NcyDJKsWePq7RAh; Mon, 16 Oct 2023 23:05:29 +0000 X-Authority-Analysis: v=2.4 cv=E/TeGIRl c=1 sm=1 tr=0 ts=652dc1b9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=M72r0Dc0uKoIkIKheg8A:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PFxaiWKjEK4G0HKRtUtTh8uMsgLsX1p4B25q3MR+I2Y=; b=VZyIdVW7ne7h31RotEKL1UQnRf C83UsXUPIQK6ER1EPKXxJ1gWuSUdsioeUoSHmnPl7iXsVG6Gzr8ETdnvEeZ/7gjbILgokeuBNGJgN r6mO72unH/o9KQ9QnJEUkooqw; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeO-003Maa-33; Mon, 16 Oct 2023 17:05:28 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/7] Switch to -Wimplicit-fallthrough=5 Date: Mon, 16 Oct 2023 17:02:41 -0600 Message-ID: <20231016230527.1820819-3-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeO-003Maa-33 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLpr4kECA0vCcq4y2GorTNm9xwj7JHH6CITYlNTvP8ndJCI10IvVXlc4mNrC2TaIUc0NPnskzpxq4pU+euZMSFIT7v8c5Lr8z9bbRjB+d/iYVjRZWraE SGrxQL1b4y2/Po4XBQR2v6WuJteVA8W/zlN5rZ0BlJXVobE7HxVQnB2dZdo5DlmgFth9mommAXKM+mWl+rij/S+k2nMqvOGTCiM= X-Spam-Status: No, score=-3024.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This changes the various gdb-related directories to use -Wimplicit-fallthrough=5, meaning that only the fallthrough attribute can be used in switches -- special 'fallthrough' comments will no longer be usable. --- gdb/configure | 2 +- gdbserver/configure | 2 +- gdbsupport/configure | 2 +- gdbsupport/warning.m4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/configure b/gdb/configure index 0878481e354..eb46a19051d 100755 --- a/gdb/configure +++ b/gdb/configure @@ -29620,7 +29620,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough=3 \ +-Wimplicit-fallthrough=5 \ -Wduplicated-cond \ -Wshadow=local \ -Wdeprecated-copy \ diff --git a/gdbserver/configure b/gdbserver/configure index c6b8d7803c4..957fecab9f0 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -11892,7 +11892,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough=3 \ +-Wimplicit-fallthrough=5 \ -Wduplicated-cond \ -Wshadow=local \ -Wdeprecated-copy \ diff --git a/gdbsupport/configure b/gdbsupport/configure index 0ef3d25a10b..ae36a20dd15 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -12389,7 +12389,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough=3 \ +-Wimplicit-fallthrough=5 \ -Wduplicated-cond \ -Wshadow=local \ -Wdeprecated-copy \ diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4 index ea573c63c4a..774f0208e9b 100644 --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -44,7 +44,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough=3 \ +-Wimplicit-fallthrough=5 \ -Wduplicated-cond \ -Wshadow=local \ -Wdeprecated-copy \ From patchwork Mon Oct 16 23:02:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77905 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BABF03857012 for ; Mon, 16 Oct 2023 23:06:04 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 248763858C54 for ; Mon, 16 Oct 2023 23:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 248763858C54 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 248763858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497532; cv=none; b=I4YzcWSs3BJ8BXQlEkvQJLRKh1Nn+Vqa70EtyG5r3Hi3al1JV40rQyrDRO9cxkDGBxtpHUkz6nZydDlUALL06MOX/hZuA2c0mtDqvJ0tIv4T7yyVR5wTEmJ5+eyLRxYMqQSCP5roSvORtQVlfkvg45HbeyRTM5Ee0LV6w7fq9bM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497532; c=relaxed/simple; bh=ZYVYfrxqtUCs8XAxIhDo672ZiqnpskFYJTYSAVOyzic=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WfPjS0XaFJ7fWLmiU1hodzhZa+gW5EZn57M7cQ2uPlOMXM1UD5wAfLMwCVFFkJj9rOGVMWYO6j0GES0+4lQbgxQhdJGk21W63KsseCE8Xoqta2rUVxkEbob1DCjcH1v2u/8eVhvmrbseERkKVJda/EJXHwqJCTVVgxfXoY2gKmI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id sWRBqaCKzOFScsWeQqX1LT; Mon, 16 Oct 2023 23:05:30 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWePqy1EorT4CsWePqzJOD; Mon, 16 Oct 2023 23:05:29 +0000 X-Authority-Analysis: v=2.4 cv=f/hbuc+M c=1 sm=1 tr=0 ts=652dc1b9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=6K-99XNBvaN-ywHE-TcA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JsQd8qARsoeV5nEFGhutAqOP16RDGjrB/kyGO1ZOyYM=; b=BhGatsspi2LGobIGNo7XOHpBdz SNH4s5dfpiMW25d+i9qDA67L3MdFjm8M3M5l75MTWraReKH+RUNl2cdv5aqoFVONQF+ZBTqIILQIg /wBrrgUfn70NHZv8NMR0Vu1sm; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeP-003Maa-0L; Mon, 16 Oct 2023 17:05:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/7] Enable some C++14 code in array-view.h Date: Mon, 16 Oct 2023 17:02:42 -0600 Message-ID: <20231016230527.1820819-4-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeP-003Maa-0L X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfCMZMeLcJXsHnguSUz/bpozvxBnojpC095nmLDurD6Bhd1EFSr9rbnKQuQMB05oZnXEluRbBNBh0ONhGYKKp4tjiIKtBuFSQz0Wp0lvgNKjk7ZNAVYNj loPjr6aeZWfKGaUXXygtMFxM3NCSek1qapjzwxIjZnr/PlceAzgf3c20mub2N2HphAq7/d/3PG5gUh/p6mJNodgla5ofiyksUBA= X-Spam-Status: No, score=-3024.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This changes gdbsupport/array-view.h to enable some code that is C++14-specific. --- gdbsupport/array-view.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gdbsupport/array-view.h b/gdbsupport/array-view.h index ee3a3c58710..d58b99fb647 100644 --- a/gdbsupport/array-view.h +++ b/gdbsupport/array-view.h @@ -153,18 +153,17 @@ class array_view : m_array (c.data ()), m_size (c.size ()) {} - /* Observer methods. Some of these can't be constexpr until we - require C++14. */ - /*constexpr14*/ T *data () noexcept { return m_array; } + /* Observer methods. */ + constexpr T *data () noexcept { return m_array; } constexpr const T *data () const noexcept { return m_array; } - /*constexpr14*/ T *begin () noexcept { return m_array; } + constexpr T *begin () noexcept { return m_array; } constexpr const T *begin () const noexcept { return m_array; } - /*constexpr14*/ T *end () noexcept { return m_array + m_size; } + constexpr T *end () noexcept { return m_array + m_size; } constexpr const T *end () const noexcept { return m_array + m_size; } - /*constexpr14*/ reference operator[] (size_t index) noexcept + constexpr reference operator[] (size_t index) noexcept { #if defined(_GLIBCXX_DEBUG) gdb_assert (index < m_size); @@ -173,7 +172,7 @@ class array_view } constexpr const_reference operator[] (size_t index) const noexcept { -#if defined(_GLIBCXX_DEBUG) && __cplusplus >= 201402L +#if defined(_GLIBCXX_DEBUG) gdb_assert (index < m_size); #endif return m_array[index]; @@ -187,7 +186,7 @@ class array_view /* Return a new array view over SIZE elements starting at START. */ constexpr array_view slice (size_type start, size_type size) const noexcept { -#if defined(_GLIBCXX_DEBUG) && __cplusplus >= 201402L +#if defined(_GLIBCXX_DEBUG) gdb_assert (start + size <= m_size); #endif return {m_array + start, size}; @@ -197,7 +196,7 @@ class array_view inclusive. */ constexpr array_view slice (size_type start) const noexcept { -#if defined(_GLIBCXX_DEBUG) && __cplusplus >= 201402L +#if defined(_GLIBCXX_DEBUG) gdb_assert (start <= m_size); #endif return {m_array + start, size () - start}; From patchwork Mon Oct 16 23:02:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77903 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0CAC3858004 for ; Mon, 16 Oct 2023 23:05:50 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 273B13858C66 for ; Mon, 16 Oct 2023 23:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 273B13858C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 273B13858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497532; cv=none; b=UTBzrDX0kbrxsTEKgNvcN7I67Qjf7fpAdk+z/P6ysx3wdh0fgfHTandssK6PlIzAAsHYwJyjVPHamrP2C2yJmhZt6Wv8dgX0wkVHtt/mhGvnoc62phXHn+oClKiX0tXwMejSbQuYOVd8hHxpFudCP6hkRer2dmYyyKuyLkmK+0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497532; c=relaxed/simple; bh=4dzzNtxBMTqzTBObyfUG1B9YFRpG/XVqmRsCgqsaAes=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tXUGwb52CYLzTTv3nl+TUdUr8ONEc//cbpkgEl+Fatg/HyDhDkBnC+kNCTmVVWkMkCAd+FtHyAQB+CGN1KkTZwJDQQoFaJ3eyAgpv28uFFOQa1686BNLoWKeuBB4npCzM4WLM7oe5fY9FX4mp71hcsUX4di9uPlL1aS3P77xlxU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id sWRIqaCYpOFScsWeQqX1Lc; Mon, 16 Oct 2023 23:05:30 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWePqPEk8fDvnsWePqbRYu; Mon, 16 Oct 2023 23:05:29 +0000 X-Authority-Analysis: v=2.4 cv=O7oqATxW c=1 sm=1 tr=0 ts=652dc1b9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=L9FUc2kav00zxSIjVgoA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0C6l7nz7piUjFkIo+b4nNbSuqHP2WAmIH87wtOrKDJo=; b=vyuJkX76jojdSoz8K7oIPJjQd3 PsGWbkNyYiSMafT7Gq2NRVp8uZiBeUGVVnhKbcSbwhcs6ScpFjNWUBmIvptuuvO4Ae7XLmiL0QhC/ +Pw6Zk+ISwqbEF0PiJtcfh+dz; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeP-003Maa-0p; Mon, 16 Oct 2023 17:05:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 4/7] Use try_emplace in index-write.c Date: Mon, 16 Oct 2023 17:02:43 -0600 Message-ID: <20231016230527.1820819-5-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeP-003Maa-0p X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfEg+JfWfmf21/8b2QxRojlTQgHHduWbh6VbK5gHD3zm6VFVq0Gp2CiIqiO//Qe0Lqi2PYoXv4S1md4Q4IdfqhlF3sEtOPNWhlYTtC+jKJrp5iiDjrq1B aKf8L7Z6m7lJwPT9LbpjPoxsGgpb8pNv1ILi5KZq8zY1qwZf9JJ38ajzWTFQ8m1jTPJU/4eBCuL7JfozpUpiYdBwu735vHHb7pE= X-Spam-Status: No, score=-3024.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org index-write.c has a comment indicating that C++17's try_emplace could be used. This patch makes the change. --- gdb/dwarf2/index-write.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index a6d770c9ee5..e402d407ee7 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -384,24 +384,16 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) continue; gdb_assert (entry.index_offset == 0); - /* Finding before inserting is faster than always trying to - insert, because inserting always allocates a node, does the - lookup, and then destroys the new node if another node - already had the same key. C++17 try_emplace will avoid - this. */ - const auto found - = symbol_hash_table.find (entry.cu_indices); - if (found != symbol_hash_table.end ()) + const auto &pair = symbol_hash_table.try_emplace (entry.cu_indices, + cpool.size ()); + entry.index_offset = pair.first->second; + if (pair.second) { - entry.index_offset = found->second; - continue; + /* Newly inserted. */ + cpool.append_offset (entry.cu_indices.size ()); + for (const auto index : entry.cu_indices) + cpool.append_offset (index); } - - symbol_hash_table.emplace (entry.cu_indices, cpool.size ()); - entry.index_offset = cpool.size (); - cpool.append_offset (entry.cu_indices.size ()); - for (const auto index : entry.cu_indices) - cpool.append_offset (index); } } From patchwork Mon Oct 16 23:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77908 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B1F53858032 for ; Mon, 16 Oct 2023 23:06:22 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id 6EB6C3858C33 for ; Mon, 16 Oct 2023 23:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6EB6C3858C33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6EB6C3858C33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497535; cv=none; b=GQfITlJzt6Y368VMUUL25O9kpXx7hnlg3DZjjJLboa1osXBxiOHDyawf8/Fvse6Efss2xFXHwRvdZodsN9VQqXCkEw7wZwgg4TZQdz7nLlw998V5xKgnyt2Vimy27Z/OmKzrOfMWhbEHq/JVlLpTvHA0sjln/k03dvAO5MKTbss= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497535; c=relaxed/simple; bh=j30/rsf6xPpvVzzroHMoGM/TSu3LG91VRNmwe/toSSs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JyrS1TlysdV8bO7pziCZ7SKxV/I5lzuxgvP0PL6EB6ZhFsOQDvxRJDYtM5E8OarpgkA4ngoq4uHKepZb2EnTqNcqGK2mde+rrNZmRokiWA45G0zhebzi/qqs/39mGxANgmlFRK5JRA4aE+Gv6QCXeYFcWNEsCt+UElWu69NhgDo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6001a.ext.cloudfilter.net ([10.0.30.140]) by cmsmtp with ESMTPS id sWJiqQClbCtB2sWdxqGH7i; Mon, 16 Oct 2023 23:05:02 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWePqnEvu24gKsWePqtH0H; Mon, 16 Oct 2023 23:05:30 +0000 X-Authority-Analysis: v=2.4 cv=fOQqYLWe c=1 sm=1 tr=0 ts=652dc1ba a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=N85ULcIM6Eg063hmoFgA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1z3E/jn+4s9bmAVWhdAwTM0t/W2jJdv+rgrxfZLlGgM=; b=R+MntIV5PZkuM4M3+ijZuRSg3h Y1JU5YAZ74Qd9OvAcvHm9i2/PqAVVlHowjeOcOzqTFxF+8yHEUhvmVLpiKKXrxXFIBJBre47HxKXY FFmiOnC2/3ONFNWx0/6Iajf0e; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeP-003Maa-1O; Mon, 16 Oct 2023 17:05:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 5/7] Rely on C++17 in new-op.cc Date: Mon, 16 Oct 2023 17:02:44 -0600 Message-ID: <20231016230527.1820819-6-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeP-003Maa-1O X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGcWkgsUR2SzNUfXHAWfSe3gaEVtOCkWp/9zw5rzb4dgotwEtK2lymrtc6tdUda3A3petsji1ITtgw46cMA1D46+J/AXJBCwW6F8jmnJfQRZ0olRPyEt nN3txFND2edbvsNCqp5u5hGupT+MubsMra2w8IW1OjZW3aYSfNPDly949GN4XOscZDl2QgJKYcEh3dPpPXeFqftZJMDdUUror6Q= X-Spam-Status: No, score=-3024.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org gdbsupport/new-op.cc has a comment about relying on the C++-17 header. This patch implements the suggestion. --- gdbsupport/new-op.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gdbsupport/new-op.cc b/gdbsupport/new-op.cc index 6a056ef508f..181fc4957fa 100644 --- a/gdbsupport/new-op.cc +++ b/gdbsupport/new-op.cc @@ -27,11 +27,6 @@ #include "host-defs.h" #include -/* These are declared in starting C++14. Add these here to enable - compilation using C++11. */ -extern void operator delete (void *p, std::size_t) noexcept; -extern void operator delete[] (void *p, std::size_t) noexcept; - /* Override operator new / operator new[], in order to internal_error on allocation failure and thus query the user for abort/core dump/continue, just like xmalloc does. We don't do this from a From patchwork Mon Oct 16 23:02:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77904 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3FC413857713 for ; Mon, 16 Oct 2023 23:05:55 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 2C8E43858C2A for ; Mon, 16 Oct 2023 23:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C8E43858C2A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2C8E43858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497532; cv=none; b=HmrqoWfmPR/XEWRqgWQuBwZL1lpmZP4Kv4MQiSK6UIPddfg/fmfC1d0Niyz5UNw+aVVjUa5NjdD+indsXsCAyysz3IYtJ0DuhYVkqt7/xEEvVPo8pIfWGKMdUzjSRVGQbxXIwk63Qch3V56BxdkP9otHWT0kBcEE8XMBOdkp36Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497532; c=relaxed/simple; bh=vPpJQELIMU5gfAt18c6FYA/La2fQk2MYjtSd7PjieTo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gRMmWI3mTB7xxOSfUhtQaqMxbZgC8To0EIKomboNLQv/N/C8e9I7acaI3OIlqYmq/hZTRmyIfoCc43XzqLb6V28he7rW1NE/A0fCifCJxIj2nZa+PCZ3uKah+Lg3lMyCps8+D3ltFJbIoOoYxwFqy3XzEfN1611M8bamLkwtGg8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6005a.ext.cloudfilter.net ([10.0.30.201]) by cmsmtp with ESMTPS id sWRFqaCSnOFScsWeQqX1Lg; Mon, 16 Oct 2023 23:05:31 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWePqyU5FqfNqsWeQqGu5o; Mon, 16 Oct 2023 23:05:30 +0000 X-Authority-Analysis: v=2.4 cv=LK11/ba9 c=1 sm=1 tr=0 ts=652dc1ba a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=snd5DWcRwXxGJMnhv3gA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=uOhRCcFTeVRFcJqhMb6g3W/DU5wD+/vQIKv2LIMKFr4=; b=Pn9lwQ0qVs1NH/B6xacXPrnIbw kARecXk5m+FXETXQNLhGjPJR8SZy3/y96LYuMdQ/oYUcjEAU48kPpVfTCLGCaPg8wwdRS4Or6wATe x7J0Bbv45BG6zt88QXKsySIVj; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeP-003Maa-1v; Mon, 16 Oct 2023 17:05:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 6/7] Rely on copy elision in scope-exit.h Date: Mon, 16 Oct 2023 17:02:45 -0600 Message-ID: <20231016230527.1820819-7-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeP-003Maa-1v X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOtFkOmyzpTxEEYQma5uShezsGjcXQJpEIj74zymBw35uWB1KpJYLYmCfJU9GIMM4dI3VFNhFdN43VdF3FiHiuyfp6IeE9Z/ak5OkjasXDEDh/W2TucU g6dncnfKI9Che8ZGMwL1o8j4h1cAiIYz0UiRa5YJqlxwA5q1o2QoKne8LKCwV6lgbq2k+p9umNVSlo/cyI0Al8n690Uo/2kdRAQ= X-Spam-Status: No, score=-3024.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org gdbsupport/scope-exit.h has a couple of comments about being able to rely on copy elision in C++17. This patch makes the change. --- gdbsupport/scope-exit.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/gdbsupport/scope-exit.h b/gdbsupport/scope-exit.h index cb8d9255869..8fa40b1ca8a 100644 --- a/gdbsupport/scope-exit.h +++ b/gdbsupport/scope-exit.h @@ -69,16 +69,7 @@ class scope_exit_base } } - /* This is needed for make_scope_exit because copy elision isn't - guaranteed until C++17. An optimizing compiler will usually skip - calling this, but it must exist. */ - scope_exit_base (const scope_exit_base &other) - : m_released (other.m_released) - { - other.m_released = true; - } - - void operator= (const scope_exit_base &) = delete; + DISABLE_COPY_AND_ASSIGN (scope_exit_base); /* If this is called, then the wrapped function will not be called on destruction. */ @@ -132,16 +123,7 @@ class scope_exit : public scope_exit_base> rhs.release (); } - /* This is needed for make_scope_exit because copy elision isn't - guaranteed until C++17. An optimizing compiler will usually skip - calling this, but it must exist. */ - scope_exit (const scope_exit &other) - : scope_exit_base> (other), - m_exit_function (other.m_exit_function) - { - } - - void operator= (const scope_exit &) = delete; + DISABLE_COPY_AND_ASSIGN (scope_exit); void operator= (scope_exit &&) = delete; private: From patchwork Mon Oct 16 23:02:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 77906 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 820F6385C6F0 for ; Mon, 16 Oct 2023 23:06:05 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id A89233858C39 for ; Mon, 16 Oct 2023 23:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A89233858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A89233858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497535; cv=none; b=Yj5QwK9msLemY36Xx/vyFhzdoPDmX7tnv/nyZ/TmtIaImegPaAUQZCPirFFKf91R15Fa12K9RVteUUCqT1zozBSuoRGT8WH9+lgHH8OKmr5Q/OEfNKWPGLikLIqpDr/BG8K+tC1NTMBb7bvTDHGRa8wVcd2b/4UzYmGjuvtMYG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697497535; c=relaxed/simple; bh=G9TyQZL1bnOAwqfCEDGgUA//lRoBYr7af5Elrnrs8nU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AY1gqYE5ndi85IQNqtNaqW+eBrbirw/WcHbxnn7DgtLpxY3dEv/WHY1sMac3Zy93KZOD8JvyoIswMVUnKWnEh7rlfHv2nDhvr3g9MoJSRIcD0t1bs/tExYi16aYpQDvDpm7bzvD7Bwu+cfJLQCIpCFRKTaYliAVSUm16YXPG8Ks= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6003a.ext.cloudfilter.net ([10.0.30.151]) by cmsmtp with ESMTPS id sWJhqQCklCtB2sWe0qGH8y; Mon, 16 Oct 2023 23:05:04 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id sWeSqL2OKYzPXsWeSqzTth; Mon, 16 Oct 2023 23:05:32 +0000 X-Authority-Analysis: v=2.4 cv=FokWQknq c=1 sm=1 tr=0 ts=652dc1bc a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=2QSLavsyAAAA:8 a=b4LDLZbEAAAA:8 a=y3UJ3sWEwogrn46Y7Q8A:9 a=9H_80fVQ3bbXSWzY4Kdq:22 a=20T61YgZp4ItGotXEy2O:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kvAqsr32VngiVUQEq688+n0h0U0kshhPSU1h8dPH+2s=; b=VbUSljeL6APz+yA0CVhAUGlMlb 90gsEgwF9J7jTjEmHc1tjhyxEoP19X9txwLq/F2OhErrkamOQEWPDgMnnNyjMcl9Qfdhp3uce65zS fDR0Ggp4pGzZLRfkXp9pgkXsz; Received: from [161.98.8.3] (port=38490 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qsWeQ-003Maa-0A; Mon, 16 Oct 2023 17:05:31 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 7/7] Use C++17 void_t Date: Mon, 16 Oct 2023 17:02:46 -0600 Message-ID: <20231016230527.1820819-8-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016230527.1820819-1-tom@tromey.com> References: <20231016230527.1820819-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1qsWeQ-003Maa-0A X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:38490 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAb/Lt+2Vo3Pw7Tm2otNW3QLDaFValLzofYRc+VtHeC00TrbyGnhsviXwEwUSBXpBsmJk6orpCfNY5DIVoOCz/EEsteFdn7Fd7InrMXm63WnMrL7Y+D3 vsAZML1k7sZTn0GDwf/+6okRGhd2JxbbPxJSlVvOXJgJwTl1xxToGRQcXsqUJCUxPPZuMupzG3oickWFEC+NJI3BLVCcWwhX4cE= X-Spam-Status: No, score=-3024.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org C++17 has void_t and make_void, so gdbsupport/traits.h can be simplified. --- gdbsupport/traits.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/gdbsupport/traits.h b/gdbsupport/traits.h index f6bb64911be..277e117bead 100644 --- a/gdbsupport/traits.h +++ b/gdbsupport/traits.h @@ -43,15 +43,6 @@ namespace gdb { -/* Pre C++14-safe (CWG 1558) version of C++17's std::void_t. See - . */ - -template -struct make_void { typedef void type; }; - -template -using void_t = typename make_void::type; - /* Implementation of the detection idiom: - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf @@ -79,7 +70,7 @@ struct detector /* Implementation of the detection idiom (positive case). */ template class Op, typename... Args> -struct detector>, Op, Args...> +struct detector>, Op, Args...> { using value_t = std::true_type; using type = Op;