diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2018-07-02 20:11:15 +0000 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2018-09-18 17:53:49 -0700 |
commit | e2284c4c44cc25133a45bfc8b0a0dc6182da0ce9 (patch) | |
tree | dfb09663fef7a9e902a3effaa1d2b58a61a5119d | |
parent | e9bb2b4bd6c6c411878dde550b48e27b8f540dfc (diff) | |
download | libcxx-master-cuttlefish-testing-release.tar.gz |
[Win32] Overload ==, != for locale_t and long longandroid-o-mr1-iot-release-1.0.5master-cuttlefish-testing-release
Summary:
_is_chartype_l (needed for isxdigit_l) in MinGW compares locale_t and NULL.
NULL is 'long long' for 64-bit, and this results in ambiguous overloads when
compiled with Clang. Define a concrete overload for the operators to fix the
ambiguity.
Reviewers: mstorsjo, EricWF, srhines, danalbert
Subscribers: christof, cfe-commits, ldionne
Differential Revision: https://reviews.llvm.org/D48749
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336141 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/support/win32/locale_win32.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/support/win32/locale_win32.h b/include/support/win32/locale_win32.h index aebfff22e..68682c962 100644 --- a/include/support/win32/locale_win32.h +++ b/include/support/win32/locale_win32.h @@ -46,6 +46,10 @@ public: return __left.__locale == nullptr && __right == 0; } + friend bool operator==(const locale_t& __left, long long __right) { + return __left.__locale == nullptr && __right == 0; + } + friend bool operator==(const locale_t& __left, std::nullptr_t) { return __left.__locale == nullptr; } @@ -66,6 +70,10 @@ public: return !(__left == __right); } + friend bool operator!=(const locale_t& __left, long long __right) { + return !(__left == __right); + } + friend bool operator!=(const locale_t& __left, std::nullptr_t __right) { return !(__left == __right); } |