Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: "Sing, Victoria" <Victoria.Sing@amd.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: don't let decltype(nullptr) hide the decltype keyword
Date: Wed, 14 Oct 2026 10:40:47 -0600	[thread overview]
Message-ID: <87pkxc2q28.fsf@tromey.com> (raw)
In-Reply-To: <DS4PR12MB9683AAEDF6BC68FBC93E4441FD952@DS4PR12MB9683.namprd12.prod.outlook.com> (Victoria Sing's message of "Tue, 6 Oct 2026 17:16:55 +0000")

>>>>> Sing, Victoria <Victoria.Sing@amd.com> writes:

> The attached patch fixes GDB failing to parse expressions that use
> "decltype" when the program contains a type named "decltype(nullptr)",
> which is the name compilers use for std::nullptr_t in debug
> information.

> This happens because "decltype" was a normal name in C++ before C++11.
> To support older code, GDB first checks whether the program has
> something named "decltype".  If it does, GDB uses that thing instead of
> treating "decltype" as a keyword.

> That check is too loose.  In C++, GDB ignores anything in parentheses at
> the end of a name, so that "foo" finds a function "foo(int)".  Because
> of this, the check also finds the type "decltype(nullptr)", and GDB
> wrongly stops treating "decltype" as a keyword.

I wonder if we even want to have a symbol named 'decltype(nullptr)' at
all?

That is, I wonder if this oddity should be filtered out in the DWARF
reader.

Tom

      reply	other threads:[~2026-10-14 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 17:16 Sing, Victoria
2026-10-14 16:40 ` Tom Tromey [this message]

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=87pkxc2q28.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=Victoria.Sing@amd.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