diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-05 23:07:18 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-05 23:07:18 +0000 |
commit | 37d42dd9bc3fceaaaed66f1dc9dabf8835bbbcab (patch) | |
tree | 81a5fd77bf0fb0e4cb75071bebe0f22365d736a4 /libstdc++-v3/testsuite | |
parent | 6f2331d7c0dba193e6427b54d9cf1f4f8f17c099 (diff) | |
download | gcc-37d42dd9bc3fceaaaed66f1dc9dabf8835bbbcab.tar.gz |
2005-07-05 Paolo Carlini <pcarlini@suse.de>
Add class __versa_string, a versatile "basic_string-type" class:
an additional, non-standard, template parameter allows to specify
the preferred base class. Two are provided: __rc_string_base,
which implements a behavior very similar to our standard string,
and __sso_string_base, not reference-counted and optimized for
short strings.
* include/ext/rc_string_base.h: New.
* include/ext/sso_string_base.h: Likewise.
* include/ext/vstring.h: Likewise.
* include/ext/vstring.tcc: Likewise.
* include/ext/vstring_fwd.h: Likewise.
* include/ext/vstring_util.h: Likewise.
* include/Makefile.am: Add.
* include/Makefile.in: Regenerate.
* testsuite/ext/vstring/explicit_instantiation/1.cc: New.
* testsuite/ext/vstring/explicit_instantiation/2.cc: Likewise.
* testsuite/ext/vstring/explicit_instantiation/char/1.cc: Likewise.
* testsuite/ext/vstring/explicit_instantiation/wchar_t/1.cc: Likewise.
* Makefile.in: Regenerate with autotools 1.9.3 (to date, the version
officially used by v3).
* aclocal.m4: Likewise.
* libmath/Makefile.in: Likewise.
* libsupc++/Makefile.in: Likewise.
* po/Makefile.in: Likewise.
* src/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
5 files changed, 159 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 242dc2e30a0..91e1874ebab 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.9.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/1.cc new file mode 100644 index 00000000000..97a1f745291 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/1.cc @@ -0,0 +1,36 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This file tests explicit instantiation of __versa_string + +#include <ext/vstring.h> + +// { dg-do compile } + +// libstdc++/21770 +template class __gnu_cxx::__versa_string<int, std::char_traits<int>, + std::allocator<char> >; diff --git a/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/2.cc new file mode 100644 index 00000000000..8606c8160a2 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/2.cc @@ -0,0 +1,41 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This file tests explicit instantiation of __versa_string + +#include <ext/vstring.h> + +// { dg-do compile } + +// libstdc++/21770 +template class __gnu_cxx::__versa_string<int, std::char_traits<int>, + std::allocator<char>, + __gnu_cxx::__sso_string_base>; + +template class __gnu_cxx::__versa_string<int, std::char_traits<int>, + std::allocator<char>, + __gnu_cxx::__rc_string_base>; diff --git a/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/char/1.cc b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/char/1.cc new file mode 100644 index 00000000000..661e99e4a7b --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/char/1.cc @@ -0,0 +1,40 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This file tests explicit instantiation of __versa_string + +#include <ext/vstring.h> + +// { dg-do compile } + +template class __gnu_cxx::__versa_string<char, std::char_traits<char>, + std::allocator<char>, + __gnu_cxx::__sso_string_base>; + +template class __gnu_cxx::__versa_string<char, std::char_traits<char>, + std::allocator<char>, + __gnu_cxx::__rc_string_base>; diff --git a/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/wchar_t/1.cc b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/wchar_t/1.cc new file mode 100644 index 00000000000..e8f0b959f55 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/explicit_instantiation/wchar_t/1.cc @@ -0,0 +1,40 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This file tests explicit instantiation of __versa_string + +#include <ext/vstring.h> + +// { dg-do compile } + +template class __gnu_cxx::__versa_string<wchar_t, std::char_traits<wchar_t>, + std::allocator<wchar_t>, + __gnu_cxx::__sso_string_base>; + +template class __gnu_cxx::__versa_string<wchar_t, std::char_traits<wchar_t>, + std::allocator<wchar_t>, + __gnu_cxx::__rc_string_base>; |