From: Tom Tromey <tom@tromey.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: Oh dear. I regret to inform you that commit ab816a274505933da2f854014b54901c3c3db9d2 might be unfortunate
Date: Mon, 02 Oct 2017 02:04:00 -0000 [thread overview]
Message-ID: <87h8viwbig.fsf@pokyo> (raw)
In-Reply-To: <87infy73sx.fsf@redhat.com> (Sergio Durigan Junior's message of "Sun, 01 Oct 2017 21:10:22 -0400")
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> /usr/include/c++/4.8/bits/stl_algo.h:2245:19: error: passing ‘const ada_exc_info’ as ‘this’ argument of ‘bool ada_exc_info::operator<(const ada_exc_info&)’ discards qualifiers [-fpermissive]
I don't really understand this error, and especially why I don't see it
(and didn't see it from try?), but I wonder if changing operator< and
operator== to const-qualified would help.
The appended is an attempt but I'm not sure how to test it now.
Tom
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 7e9f06c..1a0c769 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -13123,7 +13123,7 @@ ada_is_non_standard_exception_sym (struct symbol *sym)
by exception address. */
bool
-ada_exc_info::operator< (const ada_exc_info &other)
+ada_exc_info::operator< (const ada_exc_info &other) const
{
int result;
@@ -13136,7 +13136,7 @@ ada_exc_info::operator< (const ada_exc_info &other)
}
bool
-ada_exc_info::operator== (const ada_exc_info &other)
+ada_exc_info::operator== (const ada_exc_info &other) const
{
return addr == other.addr && strcmp (name, other.name) == 0;
}
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index f92b88d..a47fe82 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -387,8 +387,8 @@ struct ada_exc_info
/* The address of the symbol corresponding to that exception. */
CORE_ADDR addr;
- bool operator< (const ada_exc_info &);
- bool operator== (const ada_exc_info &);
+ bool operator< (const ada_exc_info &) const;
+ bool operator== (const ada_exc_info &) const;
};
extern std::vector<ada_exc_info> ada_exceptions_list (const char *regexp);
next prev parent reply other threads:[~2017-10-02 2:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5378.08408630571$1506886707@news.gmane.org>
2017-10-02 1:10 ` Sergio Durigan Junior
2017-10-02 2:04 ` Tom Tromey [this message]
2017-10-02 2:43 ` Sergio Durigan Junior
2017-10-02 9:10 ` Tejas Belagod
2017-10-02 9:39 ` Pedro Alves
2017-10-01 19:38 gdb-buildbot
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=87h8viwbig.fsf@pokyo \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.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