enum.fail.cpp revision 9e613ca1b359b4f5c15191650bf3b772a79aacc8
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// <functional>
11
12//  Hashing a struct w/o a defined hash should fail.
13
14#include <functional>
15#include <cassert>
16#include <type_traits>
17
18struct X {};
19
20int main()
21{
22    X x;
23    size_t h = std::hash<X>{} ( x );
24}
25