Reverting merge from trunk
[official-gcc.git] / libstdc++-v3 / testsuite / 27_io / objects / wchar_t / 13582-1_xin.cc
blobf2c7008034e2f347de8052ad10bb341150ffd741
1 // 2004-01-11 Petur Runolfsson <peturr02@ru.is>
3 // Copyright (C) 2004-2013 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 #include <iostream>
21 #include <string>
22 #include <locale>
24 // libstdc++/13582
25 void test01()
27 bool test __attribute__((unused)) = true;
28 using namespace std;
30 ios_base::sync_with_stdio(false);
31 wcout << "Type in 12345\n";
33 wstring str;
34 wchar_t c;
36 if (wcin.get(c) && !isspace(c, wcin.getloc()))
38 str.push_back(c);
39 wcin.imbue(locale("en_US"));
42 if (wcin.get(c) && !isspace(c, wcin.getloc()))
44 str.push_back(c);
45 wcin.imbue(locale("fr_FR"));
48 while (wcin.get(c) && !isspace(c, wcin.getloc()))
50 str.push_back(c);
53 wcout << str << endl;
56 int main()
58 test01();
59 return 0;