Skip to content
Snippets Groups Projects
Commit 52b7a4e1 authored by Brad King's avatar Brad King
Browse files

ENH: Added KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP try-compile to KWSys. ...

ENH: Added KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP try-compile to KWSys.  Needed to optionally bring hash table comparison operators into the global namespace when argument dependent lookup is not supported.
parent 6d08ca01
No related branches found
No related tags found
No related merge requests found
......@@ -205,6 +205,8 @@ KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_MEMBER_TEMPLATES
"Checking for member template support" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_FULL_SPECIALIZATION
"Checking for standard template specialization syntax" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
"Checking whether argument dependent lookup is supported" DIRECT)
IF(UNIX)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM
......
......@@ -76,6 +76,9 @@
/* Whether the compiler supports member templates. */
#define @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES @KWSYS_CXX_HAS_MEMBER_TEMPLATES@
/* Whether the compiler supports argument dependent lookup. */
#define @KWSYS_NAMESPACE@_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP @KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@
/* Whether the compiler supports standard full specialization syntax. */
#define @KWSYS_NAMESPACE@_CXX_HAS_FULL_SPECIALIZATION @KWSYS_CXX_HAS_FULL_SPECIALIZATION@
......@@ -128,6 +131,7 @@
# define KWSYS_CXX_DECL_TYPENAME @KWSYS_NAMESPACE@_CXX_DECL_TYPENAME
# define KWSYS_STL_HAS_ALLOCATOR_REBIND @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_REBIND
# define KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
# define KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP @KWSYS_NAMESPACE@_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
#endif
#endif
......@@ -1087,6 +1087,14 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
} // namespace @KWSYS_NAMESPACE@
// Normally the comparison operators should be found in the @KWSYS_NAMESPACE@
// namespace by argument dependent lookup. For compilers that do not
// support it we must bring them into the global namespace now.
#if !@KWSYS_NAMESPACE@_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
using @KWSYS_NAMESPACE@::operator==;
using @KWSYS_NAMESPACE@::operator!=;
#endif
#if defined(_MSC_VER)
# pragma warning (pop)
#endif
......
......@@ -108,6 +108,20 @@ template <> struct A<int*>
int main() { return A<int*>::f(); }
#endif
#ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
namespace N
{
class A {};
int f(A*) { return 0; }
}
void f(void*);
int main()
{
N::A* a = 0;
return f(a);
}
#endif
#ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND
#include <memory>
template <class T, class Alloc>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment