Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH] Unconditionally pass is_a_field_of_this in c-exp.y
Date: Sat,  6 Dec 2025 12:05:41 -0600	[thread overview]
Message-ID: <20251206180541.189881-1-tom@tromey.com> (raw)

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.
---
 gdb/c-exp.y | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

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)
     {
-- 
2.49.0


             reply	other threads:[~2025-12-06 18:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-06 18:05 Tom Tromey [this message]
2025-12-07 14:22 ` Simon Marchi
2025-12-07 15:21   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251206180541.189881-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox