basic_string.h doesn't define the non-w string version of std::stold
when certain conditions aren't met, and then a couple of tests fail to
compile.
Guard the portions of the tests that depend on std::stold with the
conditions for it to be defined.
for libstdc++-v3/ChangeLog
* testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc:
Guard non-wide stold calls with conditions for it to be
defined.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
Likewise.
void
test01()
{
+ /* If these conditions are not met, basic_string.h doesn't define
+ std::stold(const string&, size_t* = 0), and then the test would
+ fail to compile. */
+#if (_GLIBCXX_HAVE_STRTOLD && ! _GLIBCXX_HAVE_BROKEN_STRTOLD) \
+ || __DBL_MANT_DIG__ == __LDBL_MANT_DIG__
bool test = false;
using namespace std;
test = false;
}
VERIFY( test );
+#endif
}
int main()
void
test02()
{
+ /* If these conditions are not met, basic_string.h doesn't define
+ std::stold(const string&, size_t* = 0), and then the test would
+ fail to compile. */
+#if (_GLIBCXX_HAVE_STRTOLD && ! _GLIBCXX_HAVE_BROKEN_STRTOLD) \
+ || __DBL_MANT_DIG__ == __LDBL_MANT_DIG__
ostringstream os;
long double d = 272.L; // 0x1.1p+8L;
os << hexfloat << setprecision(1);
cout << "got: " << os.str() << endl;
#endif
VERIFY( os && os.str() == "15" );
+#endif
}
int