public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Cc: tom@tromey.com
Subject: [PATCH] Mark tu_abbrev_offset::operator<() const.
Date: Wed, 19 May 2021 11:49:26 -0700	[thread overview]
Message-ID: <20210519184926.22913-1-jhb@FreeBSD.org> (raw)

clang 11 with libc++'s <algorithm> fails to match the existing
operator<() for std::less<> since the method is not marked const.

gdb/ChangeLog:

	* dwarf2/read.c (tu_abbrev_offset::operator<): Mark const.
---
 gdb/ChangeLog     | 4 ++++
 gdb/dwarf2/read.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4cc0cb8794f..d8992d48106 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-19  John Baldwin  <jhb@FreeBSD.org>
+
+	* dwarf2/read.c (tu_abbrev_offset::operator<): Mark const.
+
 2021-05-17  Tom Tromey  <tom@tromey.com>
 
 	* dwarf2/read.h: Update include.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 8a57aeee61c..2cd8a95658a 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7116,7 +7116,7 @@ struct tu_abbrev_offset
   {}
 
   /* This is used when sorting.  */
-  bool operator< (const tu_abbrev_offset &other)
+  bool operator< (const tu_abbrev_offset &other) const
   {
     return abbrev_offset < other.abbrev_offset;
   }
-- 
2.31.1


             reply	other threads:[~2021-05-19 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 18:49 John Baldwin [this message]
2021-05-19 18:54 ` Simon Marchi
2021-05-20 14:41 ` 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=20210519184926.22913-1-jhb@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).