1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <functional> 10 11 // Hashing a struct w/o a defined hash should fail. 12 13 #include <functional> 14 #include <cassert> 15 #include <type_traits> 16 17 struct X {}; 18 19 int main(int, char**) 20 { 21 X x; 22 size_t h = std::hash<X>{} ( x ); 23 24 return 0; 25 } 26