From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82991 invoked by alias); 14 Sep 2017 20:39:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 82974 invoked by uid 89); 14 Sep 2017 20:39:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Sep 2017 20:39:54 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v8EKdlmS019357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Sep 2017 16:39:52 -0400 Received: by simark.ca (Postfix, from userid 112) id CB6211EB48; Thu, 14 Sep 2017 16:39:47 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 1468A1E5B9; Thu, 14 Sep 2017 16:39:47 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 14 Sep 2017 20:39:00 -0000 From: Simon Marchi To: Pedro Alves Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] Make dwarf_expr_context::stack an std::vector In-Reply-To: <28eeef72-abba-68e1-8eb3-effd6b0ab627@redhat.com> References: <1505404760-11844-1-git-send-email-simon.marchi@ericsson.com> <4470557a-be38-3188-9076-2b70cc253b7a@redhat.com> <5027066a221a87007aa58fe495973258@polymtl.ca> <28eeef72-abba-68e1-8eb3-effd6b0ab627@redhat.com> Message-ID: <550039b4f1f0118a37e84ab8be1b67ef@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 14 Sep 2017 20:39:48 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00394.txt.bz2 On 2017-09-14 18:43, Pedro Alves wrote: > On 09/14/2017 05:31 PM, Simon Marchi wrote: > >>> A couple nits and this is fine with me. >>> >>>> /* True if the piece is in memory and is known to be on the >>>> program's stack. >>>> @@ -114,7 +118,7 @@ struct dwarf_stack_value >>>> struct dwarf_expr_context >>>> { >>>> dwarf_expr_context (); >>>> - virtual ~dwarf_expr_context (); >>>> + virtual ~dwarf_expr_context () = default; >>> >>> Couldn't we just remove the dtor? >> >> I thought that this was necessary because there are subclasses that >> might have destructors. But now that I think about it more, I suppose >> it would only be relevant if we destroyed instances of subclasses >> through pointers to dwarf_expr_context? All the instances of these >> classes are static. > > I actually didn't realize _this_ was the base class. :-P > But yeah, if we never want to delete via base pointer, the dtor > could be non-virtual, and in which case it should be made > protected, to ensure that really no code outside subclasses tries > to call it directly. (And in that case, you'd still use =default;) > Really not a big deal, I'm fine with what you had. Ok, well I've pushed and left the virtual dtor there just in case it's ever needed. I don't think it changes anything at runtime. Thanks, Simon