Merged revisions 195034,195219,195245,195357,195374,195428,195599,195673,195809 via...
[official-gcc.git] / main / libstdc++-v3 / testsuite / 27_io / basic_streambuf / imbue / char / 9322.cc
blobfd90cf0b65d271ce8896444dddc5ab5bb71a0361
1 // { dg-require-namedlocale "en_US" }
2 // { dg-require-namedlocale "de_DE" }
4 // 1999-10-11 bkoz
6 // Copyright (C) 1999-2013 Free Software Foundation, Inc.
7 //
8 // This file is part of the GNU ISO C++ Library. This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
12 // any later version.
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License along
20 // with this library; see the file COPYING3. If not see
21 // <http://www.gnu.org/licenses/>.
24 // 27.5.2 template class basic_streambuf
26 #include <streambuf>
27 #include <locale>
28 #include <testsuite_hooks.h>
30 class testbuf : public std::streambuf
32 public:
33 typedef std::streambuf::traits_type traits_type;
35 testbuf() : std::streambuf() { }
38 // libstdc++/9322
39 void test08()
41 using std::locale;
42 bool test __attribute__((unused)) = true;
44 locale loc;
45 testbuf ob;
46 VERIFY( ob.getloc() == loc );
48 locale::global(locale("en_US"));
49 VERIFY( ob.getloc() == loc );
51 locale loc_de = locale("de_DE");
52 locale ret = ob.pubimbue(loc_de);
53 VERIFY( ob.getloc() == loc_de );
54 VERIFY( ret == loc );
56 locale::global(loc);
57 VERIFY( ob.getloc() == loc_de );
60 int main()
62 test08();
63 return 0;