summaryrefslogtreecommitdiffstats
path: root/libcxx/include/locale
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-01-22 17:26:08 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-01-22 17:26:08 +0000
commit2446649c1e3fca16d7524d75260d3d588c36e671 (patch)
tree06ad58b2d9cfbb3ba64001d5c395935065f44570 /libcxx/include/locale
parent7a6e20070dc5e3a1f1079619e9429f0c288f9b32 (diff)
downloadbcm5719-llvm-2446649c1e3fca16d7524d75260d3d588c36e671.tar.gz
bcm5719-llvm-2446649c1e3fca16d7524d75260d3d588c36e671.zip
Saleem Abdulrasool: If errno is defined as volatile int, the qualifier differences can cause
template typename deductions on swap<> (used in string.cpp). Use decltype(errno) to replicate the type and qualifier information for holding the errno value. Because errno is expected to be assignable, there is no need to use typename std::remove_const<decltype(errno)>::type to hold the value. llvm-svn: 173172
Diffstat (limited to 'libcxx/include/locale')
-rw-r--r--libcxx/include/locale8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/locale b/libcxx/include/locale
index cf213bb817b..91893757c8f 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -830,11 +830,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
{
if (__a != __a_end)
{
- int __save_errno = errno;
+ typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
- int __current_errno = errno;
+ typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
if (__p2 != __a_end)
@@ -870,11 +870,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
__err = ios_base::failbit;
return 0;
}
- int __save_errno = errno;
+ typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
- int __current_errno = errno;
+ typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
if (__p2 != __a_end)
OpenPOWER on IntegriCloud