Merge from trunk:

* Fixes ISO C++ does not support the ‘%lg’ gnu_printf format (refs #6852)
* explicit-failures-markup merge from trunk
* supress warnings in implicit_cast.cpp test

[SVN r78450]
This commit is contained in:
Antony Polukhin
2012-05-13 08:15:51 +00:00
parent b1b5305984
commit ca9c8d30bd
2 changed files with 14 additions and 4 deletions
+8 -4
View File
@@ -1322,7 +1322,8 @@ namespace boost {
{ using namespace std;
if (put_inf_nan(begin, end, val)) return true;
end = begin;
end += sprintf(begin,"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float>()), val);
const double val_as_double = val;
end += sprintf(begin,"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float>()), val_as_double);
return end > begin;
}
@@ -1330,7 +1331,7 @@ namespace boost {
{ using namespace std;
if (put_inf_nan(begin, end, val)) return true;
end = begin;
end += sprintf(begin,"%.*lg", static_cast<int>(boost::detail::lcast_get_precision<double>()), val);
end += sprintf(begin,"%.*g", static_cast<int>(boost::detail::lcast_get_precision<double>()), val);
return end > begin;
}
@@ -1353,8 +1354,11 @@ namespace boost {
static bool shl_real_type(float val, wchar_t* begin, wchar_t*& end)
{ using namespace std;
if (put_inf_nan(begin, end, val)) return true;
const double val_as_double = val;
end = begin + swprintf(begin, end-begin,
L"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float >()), val );
L"%.*g",
static_cast<int>(boost::detail::lcast_get_precision<float >()),
val_as_double );
return end > begin;
}
@@ -1362,7 +1366,7 @@ namespace boost {
{ using namespace std;
if (put_inf_nan(begin, end, val)) return true;
end = begin + swprintf(begin, end-begin,
L"%.*lg", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
L"%.*g", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
return end > begin;
}
+6
View File
@@ -28,5 +28,11 @@ int main()
type<foo> f = check_return(boost::implicit_cast<foo>("hello"));
type<long> z = check_return(boost::implicit_cast<long>(foo("hello")));
// warning supression:
(void)x;
(void)f;
(void)z;
return boost::report_errors();
}