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 <jhb@FreeBSD.org>
Approved-By: Luis Machado <luis.machado@arm.com>
Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
Tom Tromey
2023-10-15 11:09:07 -06:00
parent a0dc1f9a12
commit d182e39881
60 changed files with 140 additions and 143 deletions

View File

@@ -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: