From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6990 invoked by alias); 1 Aug 2013 03:48:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 6964 invoked by uid 89); 1 Aug 2013 03:48:48 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO mail-we0-f177.google.com) (74.125.82.177) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 01 Aug 2013 03:48:48 +0000 Received: by mail-we0-f177.google.com with SMTP id m46so1251863wev.22 for ; Wed, 31 Jul 2013 20:48:40 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.198.44 with SMTP id iz12mr6319125wic.32.1375328919963; Wed, 31 Jul 2013 20:48:39 -0700 (PDT) Received: by 10.217.5.3 with HTTP; Wed, 31 Jul 2013 20:48:39 -0700 (PDT) In-Reply-To: <20130801031620.GA13749@tsaunders-iceball.corp.tor1.mozilla.com> References: <1375319690-12939-1-git-send-email-tsaunders@mozilla.com> <1375319690-12939-2-git-send-email-tsaunders@mozilla.com> <20130801031620.GA13749@tsaunders-iceball.corp.tor1.mozilla.com> Date: Thu, 01 Aug 2013 03:48:00 -0000 Message-ID: Subject: Re: [PATCH 1/2] make the c++ pretty printer inherit from the C one instead of include it From: Gabriel Dos Reis To: Trevor Saunders Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-08/txt/msg00008.txt.bz2 On Wed, Jul 31, 2013 at 10:16 PM, Trevor Saunders wrote: > On Wed, Jul 31, 2013 at 10:02:29PM -0500, Gabriel Dos Reis wrote: >> On Wed, Jul 31, 2013 at 8:14 PM, Trevor Saunders wrote: >> > bootstrapped and same test results on x86_64-linux-gnu against r201084 >> > >> > gcc/cp/ >> > * cxx-pretty-print.h (cxx_pretty_printer): inherit from c_pretty_printer >> > instead of include it. >> > * (cxx_pretty_print.c): adjust accordingly. >> >> This is on my todo stack; thanks for looking into it. >> >> The way to handle this is: >> >> * yes, use inheritance -- that is what I simulated with the C abstractions >> * declare the "pointer to function fields" as virtual functions -- >> that is what I meant >> with the (necessarily poor) emulation through the casts. >> * override those that needed to be overridden in cxx_pretty_printer. >> * adjust the macros. >> * Have the associated constructors do the right thing. > > I agree with all of that, I was just trying to keep patches small but if > you prefer I guess I could do one giant patch that redoes all of this. At the minimum, the inheritance and the virtual functions should go together. -- Gaby