summaryrefslogtreecommitdiff
path: root/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
blob: 4401bc1b6507f8ce97999f8247bc2a8a3ed43a97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// <functional>

//  Hashing a struct w/o a defined hash should fail.

#include <functional>
#include <cassert>
#include <type_traits>

struct X {};

int main(int, char**)
{
    X x;
    std::size_t h = std::hash<X>{} ( x );

  return 0;
}