This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Oh dear. I regret to inform you that commit ab816a274505933da2f854014b54901c3c3db9d2 might be unfortunate
- From: Tom Tromey <tom at tromey dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Sun, 01 Oct 2017 20:04:39 -0600
- Subject: Re: Oh dear. I regret to inform you that commit ab816a274505933da2f854014b54901c3c3db9d2 might be unfortunate
- Authentication-results: sourceware.org; auth=none
- References: <5378.08408630571$1506886707@news.gmane.org> <87infy73sx.fsf@redhat.com>
>>>>> "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);