summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-01 16:37:20 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-01 16:37:20 +0000
commit7bb5e457e6d4b5a127faae5f180d7c672424fdad (patch)
treeacb5e18efe0ce7f8e02ae5ae9c902a43ad4bcf8d /libstdc++-v3/testsuite
parentb0bb73953d6ad761e985395103b13e1606a68b28 (diff)
downloadgcc-7bb5e457e6d4b5a127faae5f180d7c672424fdad.tar.gz
2003-02-01 Paolo Carlini <pcarlini@unitus.it>
Benjamin Kosnik <bkoz@redhat.com> Const correctness issue: http://gcc.gnu.org/ml/libstdc++/2003-01/msg00370.html * include/bits/locale_classes.h (locale::_Impl::_M_facets): Change type to const facet**. (locale::_Impl::_M_install_facet): Change declaration to take const facet*. (locale::facet::_M_references): Make mutable. (locale::facet::_M_add_reference): Declare const. (locale::facet::_M_remove_reference): Likewise. * include/bits/locale_facets.tcc (use_facet(const locale&)): Tweak for const facet** _M_facets. (has_facet(const locale&)): Likewise. * src/locale.cc (locale::facet::_M_add_reference): Adjust definition. (locale::facet::_M_remove_reference): Likewise. * src/localename.cc (locale::_Impl::_Impl(const _Impl&, size_t)): Tweak for const facet** _M_facets. (locale::_Impl::_Impl(const char*, size_t)): Likewise. (locale::_Impl::_Impl(facet**, size_t, bool)): Likewise. (locale::_Impl::_M_install_facet): Adjust definition to take const facet* and for const facet** _M_facets. * testsuite/22_locale/locale/cons/8.cc: Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62248 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/8.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/8.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/8.cc
new file mode 100644
index 00000000000..433fc1fe9ba
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/8.cc
@@ -0,0 +1,43 @@
+// 2003-02-01 Paolo Carlini <pcarlini@unitus.it>
+
+// Copyright (C) 2003 Free Software Foundation
+//
+// 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.
+
+// 22.1.1.2 locale constructors and destructors [lib.locale.cons]
+
+#include <locale>
+
+// Const correctness issue:
+// http://gcc.gnu.org/ml/libstdc++/2003-01/msg00370.html
+void
+test01()
+{
+ using namespace std;
+ bool test = true;
+
+ const locale l1("C");
+ const locale l2 =
+ locale(locale::classic(), &use_facet<time_get<char> >(l1));
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}