This is the mail archive of the gdb@sourceware.org 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: Quoting and the expr parser


> Date: Tue, 05 Aug 2008 12:24:04 -0700
> From: Keith Seitz <keiths@redhat.com>
> 
> Hi,
> 
> I have a simple question:
> 
> Why must one type "my_class::'operator+'" instead of simply
> "my_class::operator+"?
> 
> *Should* gdb accept the latter; after all, it's not ambiguous (assuming 
> it's not overloaded).

GDB probably should accept that if the selected language is C++.  The
problem though is that it is actually pretty difficult to make GDB
accept that wiouout the additional quotes.  Normally a '+' sign isn't
allowed in a function name, so you'd have to teach the lexer/parser
that it is allowed but only if there the "operator" keyword is used
right in front of it.  This is a fundamental problem with C++.  It is
so badly designed that it is almost impossible to write a proper
parser for it.


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