public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Mark tu_abbrev_offset::operator<() const.
@ 2021-05-19 18:49 John Baldwin
  2021-05-19 18:54 ` Simon Marchi
  2021-05-20 14:41 ` Tom Tromey
  0 siblings, 2 replies; 3+ messages in thread
From: John Baldwin @ 2021-05-19 18:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: tom

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Mark tu_abbrev_offset::operator<() const.
  2021-05-19 18:49 [PATCH] Mark tu_abbrev_offset::operator<() const John Baldwin
@ 2021-05-19 18:54 ` Simon Marchi
  2021-05-20 14:41 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2021-05-19 18:54 UTC (permalink / raw)
  To: John Baldwin, gdb-patches; +Cc: tom

On 2021-05-19 2:49 p.m., John Baldwin wrote:
> 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;
>    }
> 

LGTM (obvious, even), thanks.

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Mark tu_abbrev_offset::operator<() const.
  2021-05-19 18:49 [PATCH] Mark tu_abbrev_offset::operator<() const John Baldwin
  2021-05-19 18:54 ` Simon Marchi
@ 2021-05-20 14:41 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2021-05-20 14:41 UTC (permalink / raw)
  To: John Baldwin; +Cc: gdb-patches, tom

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

John> 	* dwarf2/read.c (tu_abbrev_offset::operator<): Mark const.

Thanks for doing this.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-20 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 18:49 [PATCH] Mark tu_abbrev_offset::operator<() const John Baldwin
2021-05-19 18:54 ` Simon Marchi
2021-05-20 14:41 ` Tom Tromey

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).