This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
a string problem
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: a string problem
- From: Gerhard Wesp <gwesp at cosy dot sbg dot ac dot at>
- Date: Tue, 12 Oct 1999 09:54:22 +0200
- Cc: Gerhard Wesp <gwesp at cosy dot sbg dot ac dot at>
- Reply-To: gwesp at cosy dot sbg dot ac dot at
hi,
i'm really a c++ beginner, but i think the following is a bug in the
stl implementation. i'd have liked to stash this report in the database,
but it doesn't work for me (does it use cookies?).
consider the following piece of code:
% cat foo.cc
#include <string>
void foo() { std::string s(10,0); }
this should declare a string of length 10, all elements initialized to
0, cf. also iso14882, 23.1.1 (9). perhaps the two arguments of the
constructor get misinterpreted as iterators, anyway, compilation yields
the following error:
% gcc -c foo.cc
/usr/lib/gcc-lib/i686-redhat-linux/2.95/../../../../include/g++-3/std/bastring.h: In method `class basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> > & basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >::replace<int>(char *, char *, int, int)':
/usr/lib/gcc-lib/i686-redhat-linux/2.95/../../../../include/g++-3/std/bastring.h:226: instantiated from here
/usr/lib/gcc-lib/i686-redhat-linux/2.95/../../../../include/g++-3/std/bastring.h:450: invalid type argument of `unary *'
/usr/lib/gcc-lib/i686-redhat-linux/2.95/../../../../include/g++-3/std/bastring.h:226: instantiated from here
/usr/lib/gcc-lib/i686-redhat-linux/2.95/../../../../include/g++-3/std/bastring.h:457: invalid type argument of `unary *'
compiler/library/system information:
% gcc -v
Reading specs from /usr/lib/gcc-lib/i686-redhat-linux/2.95/specs
gcc version 2.95 19990728 (release)
% rpm -q libstdc++
libstdc++-2.95-4
% uname -a
Linux host.domain.org 2.2.12 #5 Fri Sep 24 13:21:35 CEST 1999 i686 unknown
greetings,
-gerhard
--
| Gerhard Wesp http://www.cosy.sbg.ac.at/~gwesp
|
| Q: What do agnostic, insomniac dyslexics do at night?
| A: Stay awake and wonder if there's a dog.