]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
1 // { dg-do run { target c++11 } }
2 // { dg-require-string-conversions "" }
3 // { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io } }
5 // 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com>
7 // Copyright (C) 2008-2021 Free Software Foundation, Inc.
9 // This file is part of the GNU ISO C++ Library. This library is free
10 // software; you can redistribute it and/or modify it under the
11 // terms of the GNU General Public License as published by the
12 // Free Software Foundation; either version 3, or (at your option)
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
20 // You should have received a copy of the GNU General Public License along
21 // with this library; see the file COPYING3. If not see
22 // <http://www.gnu.org/licenses/>.
24 // 21.4 Numeric Conversions [string.conversions]
29 #include <testsuite_hooks.h>
34 #if _GLIBCXX_USE_C99_WCHAR
44 catch(const std::invalid_argument
&)
59 catch(const std::invalid_argument
&)
73 d1
= stod(one
, &idx1
);
87 one
.append(2 * numeric_limits
<double>::max_exponent10
, L
'9');
90 catch(const std::out_of_range
&)
102 long double ld0
= numeric_limits
<double>::max() / 100.0;
103 wstring
one(to_wstring(ld0
));
112 if ((numeric_limits
<long double>::max() / 10000.0L)
113 > numeric_limits
<double>::max())
119 long double ld1
= numeric_limits
<double>::max();
121 wstring
one(to_wstring(ld1
));
124 catch(const std::out_of_range
&)
132 VERIFY( d1
== -1.0 );