]> git.pld-linux.org Git - packages/gcc2.git/blame - gcc2-libstdc++-bastring.patch
- move compressed patch to distfiles
[packages/gcc2.git] / gcc2-libstdc++-bastring.patch
CommitLineData
43cb4b44
AM
1/*
2From: Richard Kettlewell <rjk@sfere.greenend.org.uk>
3To: submit@bugs.debian.org
4Subject: Bug#46550: basic_string<wchar_t> can't be instantiated
5Date: Sun, 3 Oct 1999 22:49:50 +0100
6
7Package: libstdc++2.9-dev
8Version: 2.91.60-5
9
10Hi,
11
12This ought to work, but it doesn't:
13
14------------------------------------------------------------------------
15lyonesse$ cat t.cc
16*/
17
18#include <string>
19
20template basic_string<wchar_t>;
21
22/*
23lyonesse$ c++ -c t.cc
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':
25t.cc:3: instantiated from here
26/usr/include/g++-2/std/bastring.h:301: return to `const __wchar_t *' from `char *'
27lyonesse$
28------------------------------------------------------------------------
29
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
32# DP: such):
33
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
37@@ -332,7 +332,8 @@
38
39 public:
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 ()); }
This page took 0.080752 seconds and 4 git commands to generate.