* [PATCH] Unconditionally pass is_a_field_of_this in c-exp.y
@ 2025-12-06 18:05 Tom Tromey
2025-12-07 14:22 ` Simon Marchi
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2025-12-06 18:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Unconditionally pass is_a_field_of_this in c-exp.y
2025-12-06 18:05 [PATCH] Unconditionally pass is_a_field_of_this in c-exp.y Tom Tromey
@ 2025-12-07 14:22 ` Simon Marchi
2025-12-07 15:21 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2025-12-07 14:22 UTC (permalink / raw)
To: Tom Tromey, gdb-patches
On 2025-12-06 13:05, Tom Tromey wrote:
> 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.
I didn't recall the logic exactly so I checked again. For languages for
which "this" is not relevant, lang->name_of_this() will return nullptr
in lookup_language_this. Is that it?
If so:
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-07 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-06 18:05 [PATCH] Unconditionally pass is_a_field_of_this in c-exp.y Tom Tromey
2025-12-07 14:22 ` Simon Marchi
2025-12-07 15:21 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox