This is the mail archive of the gdb-prs@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]

c++/1588: names of c++ nested types in casts must be enclosed in quotes


>Number:         1588
>Category:       c++
>Synopsis:       names of c++ nested types in casts must be enclosed in quotes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 17 20:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     carlton@kealia.com
>Release:        2004-03-17-cvs (or gdb 6.1)
>Organization:
>Environment:
any
>Description:
Say we have a type Inner contained in a class or
namespace Outer.  Then, if you print an expression
that refers to Outer::Inner in a situation where
the parser needs to know that Outer::Inner is a type
(as opposed to some other sort of variable) to
disambiguate the parse, you must enclose the name of
the type in single quotes.

This mainly shows up in casts: if you type

(gdb) p (Outer::Inner) foo

then GDB will think that the parentheses are used
for grouping instead of for a cast, unless you
use single quotes; similarly, if you type

(gdb) p (Outer::Inner *) foo

then GDB will think that the * is used for multiplication
instead of as a pointer.  (By the time it hits the
right parenthesis, it's too late.)

This issue is new to GDB 6.1; however, before GDB 6.1,
GDB would very rarely get the name of the type right
in the first place, thinking it was called "Inner"
instead of "Outer::Inner", so the issue didn't arise
very frequently.  (The only situations that I know
of where it did arise were when using GCC 3.3 or later
with -gstabs+ in a context where Outer was a class
(as opposed to a namespace) and perhaps some situations
involving HP's aCC.)
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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