From d182e39881061b11d1eb85426d9a6953e3171bf5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 15 Oct 2023 11:09:07 -0600 Subject: Use C++17 [[fallthrough]] attribute 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 Approved-By: John Baldwin Approved-By: Luis Machado Approved-By: Pedro Alves --- gdb/c-exp.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/c-exp.y') diff --git a/gdb/c-exp.y b/gdb/c-exp.y index a27dbfa..2b4c218 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 '"': -- cgit v1.1