This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/17124] GDB incorrectly says that std::string::npos is of type string
- From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 07 Jul 2014 19:30:33 +0000
- Subject: [Bug c++/17124] GDB incorrectly says that std::string::npos is of type string
- Auto-submitted: auto-generated
- References: <bug-17124-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17124
Jonathan Wakely <jwakely.gcc at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jwakely.gcc at gmail dot com
--- Comment #1 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
Reproducible with this smaller program:
typedef unsigned long size_t;
template<typename T>
struct allocator
{
typedef size_t size_type;
};
template<typename T, typename A = allocator<T> >
struct basic_string
{
typedef typename A::size_type size_type;
static const size_type npos = -1;
};
typedef basic_string<char> str;
int main()
{
str s;
return 0;
}
(gdb) ptype str::npos
type = struct basic_string<char, allocator<char> > [with T = char, A =
allocator<char>] {
static size_type npos;
typedef A::size_type size_type;
}
(N.B. I had to call the type 'str' because when I called it 'string' GDB got
confused and "ptype string::npos" gave a syntax error)
--
You are receiving this mail because:
You are on the CC list for the bug.