public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>,
	 Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Use std::optional when available
Date: Tue, 10 Oct 2023 10:49:59 -0600	[thread overview]
Message-ID: <874jiywhfs.fsf@tromey.com> (raw)
In-Reply-To: <87y1gcc6kt.fsf@redhat.com> (Andrew Burgess's message of "Mon, 09 Oct 2023 13:40:18 +0100")

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> I think this change needs to be held off until we move to C++17 - at
Andrew> which point gdb::optional can just be dropped.

Once we switch I think we can just remove this code entirely.

GDB 14 branched, so I think we're ready for that now.

>> +#if __cplusplus < 201703L

Andrew> Ignoring my previous comment for a moment; we now rely on this version
Andrew> number being defined the same in two files.  Would it be better to move
Andrew> the '#define GDB_OPTIONAL' into gdb_optional.h?  Then we can be certain
Andrew> that it will be defined correctly, and in sync with any future changes
Andrew> made in that file?

I don't think that would really help.  IIUC the issue would be compiling
two source files with different -std settings.  But in this case
gdb_optional.h would react to this.  Maybe I'm not understanding what
you mean though.

It seems to me that we simply don't need to support compiling the tree
with different std settings for different files -- it should be fine to
just assume that everything is compiled compatibly.

Tom

  reply	other threads:[~2023-10-10 16:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 16:05 Tom Tromey
2023-10-09 12:40 ` Andrew Burgess
2023-10-10 16:49   ` Tom Tromey [this message]
2023-10-12 18:44     ` Pedro Alves
2023-10-16 14:13     ` Andrew Burgess

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=874jiywhfs.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=aburgess@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).