diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-09-15 00:31:38 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-09-15 00:31:38 +0000 |
commit | 63d88110ccb598e90dcce6a5dd79353bc9ae385a (patch) | |
tree | 65971b986b0508378db617862a69b99293c9b0b8 /include | |
parent | 0a2af12aff46999f2d7547581b89630bbe908e76 (diff) |
Fix accidental ADL in std::allocator_traits meta-programming.
There were a number of cases where __double_underscore functions,
for example __has_construct_test, were called without being qualified,
causing ADL to occur. This patch qualifies those calls to avoid this
problem.
Thanks to David L. Jones for point out the issue initially.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/memory | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/memory b/include/memory index 4c1ae46ef..351529af0 100644 --- a/include/memory +++ b/include/memory @@ -1302,7 +1302,7 @@ struct __allocator_traits_rebind<_Alloc<_Tp, _A0, _A1, _A2>, _Up, false> template <class _Alloc, class _SizeType, class _ConstVoidPtr> auto __has_allocate_hint_test(_Alloc&& __a, _SizeType&& __sz, _ConstVoidPtr&& __p) - -> decltype(__a.allocate(__sz, __p), true_type()); + -> decltype((void)__a.allocate(__sz, __p), true_type()); template <class _Alloc, class _SizeType, class _ConstVoidPtr> auto @@ -1313,7 +1313,7 @@ template <class _Alloc, class _SizeType, class _ConstVoidPtr> struct __has_allocate_hint : integral_constant<bool, is_same< - decltype(__has_allocate_hint_test(declval<_Alloc>(), + decltype(_VSTD::__has_allocate_hint_test(declval<_Alloc>(), declval<_SizeType>(), declval<_ConstVoidPtr>())), true_type>::value> @@ -1346,7 +1346,7 @@ template <class _Alloc, class _Pointer, class ..._Args> struct __has_construct : integral_constant<bool, is_same< - decltype(__has_construct_test(declval<_Alloc>(), + decltype(_VSTD::__has_construct_test(declval<_Alloc>(), declval<_Pointer>(), declval<_Args>()...)), true_type>::value> @@ -1367,7 +1367,7 @@ template <class _Alloc, class _Pointer> struct __has_destroy : integral_constant<bool, is_same< - decltype(__has_destroy_test(declval<_Alloc>(), + decltype(_VSTD::__has_destroy_test(declval<_Alloc>(), declval<_Pointer>())), true_type>::value> { @@ -1387,7 +1387,7 @@ template <class _Alloc> struct __has_max_size : integral_constant<bool, is_same< - decltype(__has_max_size_test(declval<_Alloc&>())), + decltype(_VSTD::__has_max_size_test(declval<_Alloc&>())), true_type>::value> { }; @@ -1406,7 +1406,7 @@ template <class _Alloc> struct __has_select_on_container_copy_construction : integral_constant<bool, is_same< - decltype(__has_select_on_container_copy_construction_test(declval<_Alloc&>())), + decltype(_VSTD::__has_select_on_container_copy_construction_test(declval<_Alloc&>())), true_type>::value> { }; |