From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2338 invoked by alias); 28 Feb 2003 13:40:34 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2330 invoked from network); 28 Feb 2003 13:40:34 -0000 Received: from unknown (HELO cygnus.equallogic.com) (65.170.102.10) by 172.16.49.205 with SMTP; 28 Feb 2003 13:40:34 -0000 Received: from cygnus.equallogic.com (localhost.localdomain [127.0.0.1]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id h1SDeX628777 for ; Fri, 28 Feb 2003 08:40:34 -0500 Received: from deneb.dev.equallogic.com (deneb.dev.equallogic.com [172.16.1.99]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id h1SDeXr28768; Fri, 28 Feb 2003 08:40:33 -0500 Received: from pkoning.dev.equallogic.com.equallogic.com (localhost.localdomain [127.0.0.1]) by deneb.dev.equallogic.com (8.11.6/8.11.6) with ESMTP id h1SDeX815267; Fri, 28 Feb 2003 08:40:33 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15967.26320.899802.396679@pkoning.dev.equallogic.com> Date: Fri, 28 Feb 2003 13:40:00 -0000 From: Paul Koning To: drow@mvista.com Cc: gdb@sources.redhat.com Subject: Re: [rfc] xfailed tests in gdb.c++/classes.exp References: <200302280351.h1S3p6525237@duracef.shout.net> <20030228035911.GA16388@nevyn.them.org> X-SW-Source: 2003-02/txt/msg00606.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> On Thu, Feb 27, 2003 at 09:51:06PM -0600, Michael Elizabeth Daniel> Chastain wrote: dc> 1) GDB prints "class X { public: ... }" when the programmer dc> originally wrote "struct X { ... }". >> I think this should be a PASS. >> dc> 2) GDB prints "class X { private: int x; ... }" when the dc> programmer originally wrote "class X { int x; ... }". >> I think this should be a PASS. >> >> David C formulated this idea as: if the text can be fed back into >> a C++ compiler and generate the same results, then it's okay. By >> and large I agree with that. >> >> If you look in gnats, you will see users complaining that they >> can't print their string variables (because C++ strings are >> implemented with layers of templates and derived classes). They >> are complaining that operator overloading doesn't work. They are >> complaining that they have a std::vector and they can't even >> look inside the damn thing. >> >> They aren't complaining that they wrote 'struct X { ... }' but gdb >> prints 'class X { public: ... }'. Daniel> Sure. But I suspect 2) represents an actual bug. Fixing Daniel> this is about three lines in c-typeprint.c. Should we or Daniel> shouldn't we? Why? In both cases, the source code text and the GDB printout are equivalent by the C++ rules. You can replace the one by the other without any impact on the meaning of the program. Certainly for those who are only half conversant with C++ type rules, having "struct foo" replaced by "class foo { public:" may come as a surprise, but that's a good incentive for them to learn the language... paul