From patchwork Mon Oct 2 02:04:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 23276 Received: (qmail 24702 invoked by alias); 2 Oct 2017 02:04:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 24618 invoked by uid 89); 2 Oct 2017 02:04:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=regret, Hx-languages-length:1765, dear X-HELO: outbound-ss-1812.hostmonster.com Received: from gproxy1-pub.mail.unifiedlayer.com (HELO outbound-ss-1812.hostmonster.com) (69.89.25.95) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Oct 2017 02:04:47 +0000 Received: from cmgw3 (cmgw4 [10.0.90.84]) by gproxy1.mail.unifiedlayer.com (Postfix) with ESMTP id 275DE175C80 for ; Sun, 1 Oct 2017 20:04:46 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id GS4i1w00S2f2jeq01S4lz9; Sun, 01 Oct 2017 20:04:46 -0600 X-Authority-Analysis: v=2.2 cv=K/VSJ2eI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=IkcTkHD0fZMA:10 a=23ahuNLuq3sA:10 a=02M-m0pO-4AA:10 a=20KFwNOVAAAA:8 a=N1GQcyj6ARUrZD_DBsQA:9 a=NwXVY5rd3nrQzoK5:21 a=atAM2mQdoPt8uSDC:21 a=QEXdDO2ut3YA:10 Received: from 75-166-0-208.hlrn.qwest.net ([75.166.0.208]:34606 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dyq66-0045zA-KG; Sun, 01 Oct 2017 20:04:42 -0600 From: Tom Tromey To: Sergio Durigan Junior Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: Oh dear. I regret to inform you that commit ab816a274505933da2f854014b54901c3c3db9d2 might be unfortunate References: <5378.08408630571$1506886707@news.gmane.org> <87infy73sx.fsf@redhat.com> Date: Sun, 01 Oct 2017 20:04:39 -0600 In-Reply-To: <87infy73sx.fsf@redhat.com> (Sergio Durigan Junior's message of "Sun, 01 Oct 2017 21:10:22 -0400") Message-ID: <87h8viwbig.fsf@pokyo> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 X-BWhitelist: no X-Exim-ID: 1dyq66-0045zA-KG X-Source-Sender: 75-166-0-208.hlrn.qwest.net (pokyo) [75.166.0.208]:34606 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes >>>>> "Sergio" == Sergio Durigan Junior 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_exceptions_list (const char *regexp);