public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Vaseeharan Vinayagamoorthy <Vaseeharan.Vinayagamoorthy@arm.com>,
	Tom Tromey <tom@tromey.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Replace sort_tu_by_abbrev_offset with operator<
Date: Wed, 19 May 2021 16:35:19 -0700	[thread overview]
Message-ID: <11ab7e5d-5b36-fd4f-e52b-8e518e8eb9a0@FreeBSD.org> (raw)
In-Reply-To: <38657A42-8403-472B-B26B-B9F036D8BC87@arm.com>

On 5/19/21 3:22 PM, Vaseeharan Vinayagamoorthy via Gdb-patches wrote:
> I am seeing this error: passing ‘const tu_abbrev_offset’ as ‘this’ argument of ‘bool tu_abbrev_offset::operator<(const tu_abbrev_offset&)’ discards qualifiers [-fpermissive]
>    
> 
> In file included from /usr/include/c++/4.8.2/algorithm:62:0,
>                   from /src/binutils-gdb--gdb/gdb/dwarf2/read.c:85:
> /usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<tu_abbrev_offset*, std::vector<tu_abbrev_offset> >; _Tp = tu_abbrev_offset]’:
> /usr/include/c++/4.8.2/bits/stl_algo.h:2283:70:   required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<tu_abbrev_offset*, std::vector<tu_abbrev_offset> >]’
> /usr/include/c++/4.8.2/bits/stl_algo.h:2315:54:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<tu_abbrev_offset*, std::vector<tu_abbrev_offset> >; _Size = long int]’
> /usr/include/c++/4.8.2/bits/stl_algo.h:5461:36:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<tu_abbrev_offset*, std::vector<tu_abbrev_offset> >]’
> /src/binutils-gdb--gdb/gdb/dwarf2/read.c:7195:64:   required from here
> /usr/include/c++/4.8.2/bits/stl_algo.h:2245:19: error: passing ‘const tu_abbrev_offset’ as ‘this’ argument of ‘bool tu_abbrev_offset::operator<(const tu_abbrev_offset&)’ discards qualifiers [-fpermissive]
>      while (__pivot < *__last)

I might have just pushed a fix for this.  clang wasn't happy about the method not being
const and this seems like it might be a variant of the same (the method being non-const
might have had the effect of this error of removing const from 'this').

-- 
John Baldwin

      reply	other threads:[~2021-05-19 23:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15 15:19 Tom Tromey
2021-05-17 16:13 ` Simon Marchi
2021-05-19 22:22 ` Vaseeharan Vinayagamoorthy
2021-05-19 23:35   ` John Baldwin [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=11ab7e5d-5b36-fd4f-e52b-8e518e8eb9a0@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=Vaseeharan.Vinayagamoorthy@arm.com \
    --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).