]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Unconditionally pass is_a_field_of_this in c-exp.y
authorTom Tromey <tom@tromey.com>
Fri, 5 Dec 2025 18:43:08 +0000 (11:43 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 7 Dec 2025 15:21:33 +0000 (09:21 -0600)
In a review to a different patch of mine, Simon asked for this change.
The idea here is that there's no need to pass null as the "field of
this" parameter, as lookup_language_this checks the language anyway.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/c-exp.y

index 829058027f347cb94b3fcc2a2c097562bb3067c1..4ea60fe54f65b2ea17d54194c573be4fd988b113 100644 (file)
@@ -3071,10 +3071,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
 
            if (lookup_symbol (copy.c_str (),
                               pstate->expression_context_block,
-                              SEARCH_VFT,
-                              (par_state->language ()->la_language
-                               == language_cplus ? &is_a_field_of_this
-                               : NULL)).symbol
+                              SEARCH_VFT, &is_a_field_of_this).symbol
                != NULL)
              {
                /* The keyword is shadowed.  */
@@ -3136,8 +3133,7 @@ classify_name (struct parser_state *par_state, const struct block *block,
   std::string copy = copy_name (yylval.sval);
 
   bsym = lookup_symbol (copy.c_str (), block, SEARCH_VFT,
-                       par_state->language ()->name_of_this ()
-                       ? &is_a_field_of_this : NULL);
+                       &is_a_field_of_this);
 
   if (bsym.symbol && bsym.symbol->loc_class () == LOC_BLOCK)
     {