From 5f48d886a9ce0b7d109a26c860adf66330ca65cf Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 17 Aug 2022 11:47:17 -0600 Subject: Use checked_static_cast in more places I went through all the uses of dynamic_cast<> in gdb, looking for ones that could be replaced with checked_static_cast. This patch is the result. Regression tested on x86-64 Fedora 34. --- gdb/location.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/location.c') diff --git a/gdb/location.c b/gdb/location.c index 2b31baa..e4863fd 100644 --- a/gdb/location.c +++ b/gdb/location.c @@ -18,6 +18,7 @@ #include "defs.h" #include "gdbsupport/gdb_assert.h" +#include "gdbsupport/gdb-checked-static-cast.h" #include "location.h" #include "symtab.h" #include "language.h" @@ -848,8 +849,7 @@ string_to_location_spec (const char **stringp, linespec parsing below and discard the explicit location spec. */ explicit_location_spec *xloc - = dynamic_cast (locspec.get ()); - gdb_assert (xloc != nullptr); + = gdb::checked_static_cast (locspec.get ()); match_type = xloc->func_name_match_type; } -- cgit v1.1