From: Tom Tromey Date: Fri, 5 Dec 2025 18:43:08 +0000 (-0700) Subject: Unconditionally pass is_a_field_of_this in c-exp.y X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=278b24151e48fc9f52a4ee85d7e6d439ce246eac;p=thirdparty%2Fbinutils-gdb.git Unconditionally pass is_a_field_of_this in c-exp.y 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 --- diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 829058027f3..4ea60fe54f6 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -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) {