]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/pod/23875.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_ostream / inserters_arithmetic / pod / 23875.cc
1 // 2005-09-15 Paolo Carlini <pcarlini@suse.de>
2
3 // Copyright (C) 2005-2020 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.
10
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.
15
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/>.
19
20 // 27.6.2.5.2 Arithmetic inserters
21
22 #include <sstream>
23 #include <testsuite_hooks.h>
24 #include <testsuite_character.h>
25
26 using __gnu_test::pod_ushort;
27
28 namespace std
29 {
30 template<>
31 basic_ostream<pod_ushort>&
32 basic_ostream<pod_ushort>::
33 operator<<(long)
34 {
35 VERIFY( false );
36 return *this;
37 }
38
39 template<>
40 basic_ostream<pod_ushort>&
41 basic_ostream<pod_ushort>::
42 operator<<(unsigned long)
43 {
44 VERIFY( false );
45 return *this;
46 }
47
48 template<>
49 basic_ostream<pod_ushort>&
50 basic_ostream<pod_ushort>::
51 operator<<(double)
52 {
53 VERIFY( false );
54 return *this;
55 }
56 }
57
58 // libstdc++/23875
59 void test01()
60 {
61 std::basic_ostringstream<pod_ushort> ostr;
62
63 short s = 1;
64 ostr << s;
65
66 unsigned short us = 1;
67 ostr << us;
68
69 int i = 1;
70 ostr << i;
71
72 unsigned int ui = 1;
73 ostr << ui;
74
75 float f = 1.0f;
76 ostr << f;
77 }
78
79 int main()
80 {
81 test01();
82 return 0;
83 }