2 From: Richard Kettlewell <rjk@sfere.greenend.org.uk>
3 To: submit@bugs.debian.org
4 Subject: Bug#46550: basic_string<wchar_t> can't be instantiated
5 Date: Sun, 3 Oct 1999 22:49:50 +0100
7 Package: libstdc++2.9-dev
12 This ought to work, but it doesn't:
14 ------------------------------------------------------------------------
20 template basic_string<wchar_t>;
24 /usr/include/g++-2/std/bastring.h: In method `const __wchar_t * basic_string<__wchar_t,string_char_traits<__wchar_t>,__default_alloc_template<true,0> >::c_str<__wchar_t, string_char_traits<__wchar_t>, alloc>() const':
25 t.cc:3: instantiated from here
26 /usr/include/g++-2/std/bastring.h:301: return to `const __wchar_t *' from `char *'
28 ------------------------------------------------------------------------
30 # DP: Here is a patch to /usr/include/g++-2/std/bastring.h which makes it
31 # DP: work for me (though note that I have not tested the c_str() method as
34 ------------------------------------------------------------------------
35 --- libstdc++/std/bastring.h.orig Sun Oct 3 22:32:06 1999
36 +++ libstdc++/std/bastring.h Sun Oct 3 22:36:17 1999
40 const charT* c_str () const
41 - { if (length () == 0) return ""; terminate (); return data (); }
42 + { const charT* null_str = "";
43 + if (length () == 0) return null_str; terminate (); return data (); }
44 void resize (size_type n, charT c);
45 void resize (size_type n)
46 { resize (n, eos ()); }