brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 9b22cbd Raw
34 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// REQUIRES: std-at-least-c++1710 11#include <variant>12 13#include "test_macros.h"14 15using A1 [[maybe_unused]] = std::hash<std::variant<int, long>>::argument_type;16using R1 [[maybe_unused]] = std::hash<std::variant<int, long>>::result_type;17#if TEST_STD_VER >= 2018// expected-error@-3 {{no type named 'argument_type' in 'std::hash<std::variant<int, long>>'}}19// expected-error@-3 {{no type named 'result_type' in 'std::hash<std::variant<int, long>>'}}20#else21// expected-warning@-6 {{'argument_type' is deprecated}}22// expected-warning@-6 {{'result_type' is deprecated}}23#endif24 25using A2 [[maybe_unused]] = std::hash<std::monostate>::argument_type;26using R2 [[maybe_unused]] = std::hash<std::monostate>::result_type;27#if TEST_STD_VER >= 2028// expected-error@-3 {{no type named 'argument_type' in 'std::hash<monostate>'}}29// expected-error@-3 {{no type named 'result_type' in 'std::hash<monostate>'}}30#else31// expected-warning@-6 {{'argument_type' is deprecated}}32// expected-warning@-6 {{'result_type' is deprecated}}33#endif34