1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // UNSUPPORTED: c++98, c++03 11 12 // Test that the header `poisoned_hash_helper.hpp` doesn't include any 13 // headers that provide hash<T> specializations. This is required so that the 14 // 'test_library_hash_specializations_available()' function returns false 15 // by default, unless a STL header providing hash has already been included. 16 17 #include "poisoned_hash_helper.hpp" 18 19 template <class T, size_t = sizeof(T)> is_complete_imp(int)20constexpr bool is_complete_imp(int) { return true; } is_complete_imp(long)21template <class> constexpr bool is_complete_imp(long) { return false; } is_complete()22template <class T> constexpr bool is_complete() { return is_complete_imp<T>(0); } 23 24 template <class T> struct has_complete_hash { 25 enum { value = is_complete<std::hash<T> >() }; 26 }; 27 main()28int main() { 29 static_assert(LibraryHashTypes::assertTrait<has_complete_hash, false>(), ""); 30 } 31