This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] xfailed tests in gdb.c++/classes.exp


On Thu, Feb 27, 2003 at 09:51:06PM -0600, Michael Elizabeth Chastain wrote:
> dc> 1) GDB prints "class X { public: ... }" when the programmer originally
> dc>    wrote "struct X { ... }".
> 
> I think this should be a PASS.
> 
> dc> 2) GDB prints "class X { private: int x; ... }" when the programmer
> dc>    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<Foo> 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: ... }'.

Sure.  But I suspect 2) represents an actual bug.  Fixing this is about
three lines in c-typeprint.c.  Should we or shouldn't we?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]