]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Only search types in lookup_typename
authorTom Tromey <tom@tromey.com>
Tue, 19 Sep 2023 23:46:38 +0000 (17:46 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 28 Jan 2024 17:58:17 +0000 (10:58 -0700)
This changes lookup_typename to only look for types.  The check for
LOC_TYPEDEF can now also be removed, because only types will appear in
TYPE_DOMAIN.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24870

gdb/gdbtypes.c

index 970a9e4a4a52744b4c431cda70726a357b1c80b8..a48c4c8abf280ed60f3eaafb8f78463fa9cbb04d 100644 (file)
@@ -1655,9 +1655,9 @@ lookup_typename (const struct language_defn *language,
 {
   struct symbol *sym;
 
-  sym = lookup_symbol_in_language (name, block, SEARCH_VFT,
+  sym = lookup_symbol_in_language (name, block, SEARCH_TYPE_DOMAIN,
                                   language->la_language, NULL).symbol;
-  if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
+  if (sym != nullptr)
     {
       struct type *type = sym->type ();
       /* Ensure the length of TYPE is valid.  */