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

[Bug c++/17124] GDB incorrectly says that std::string::npos is of type string


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.


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