1 // { dg-options "-std=gnu++0x" }
2 // { dg-require-string-conversions "" }
4 // 2009-11-11 Paolo Carlini <paolo.carlini@oracle.com>
6 // Copyright (C) 2009-2013 Free Software Foundation, Inc.
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)
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 #include <testsuite_hooks.h>
26 // DR 1261. Insufficient overloads for to_string / to_wstring
29 bool test __attribute__((unused)) = true;
32 const wstring one(to_wstring(-2));
33 VERIFY( one == L"-2" );
35 const wstring two(to_wstring(10u));
36 VERIFY( two == L"10" );
38 const wstring three(to_wstring(2l));
39 VERIFY( three == L"2" );
41 const wstring four(to_wstring(3000ul));
42 VERIFY( four == L"3000" );
44 const wstring five(to_wstring(7ll));
45 VERIFY( five == L"7" );
47 const wstring six(to_wstring(400ull));
48 VERIFY( six == L"400" );
50 const wstring seven(to_wstring(-1.0F));
51 VERIFY( seven == L"-1.000000" );
53 const wstring eight(to_wstring(2.0));
54 VERIFY( eight == L"2.000000" );
56 const wstring nine(to_wstring(-4.0L));
57 VERIFY( nine == L"-4.000000" );