brintos

brintos / llvm-project-archived public Read only

0
0
Text · 610 B · 4401bc1 Raw
26 lines · cpp
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-exception6//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 17struct X {};18 19int main(int, char**)20{21    X x;22    std::size_t h = std::hash<X>{} ( x );23 24  return 0;25}26