]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
Vendor import of libc++ trunk r290819:
[FreeBSD/FreeBSD.git] / test / std / utilities / variant / variant.variant / variant_reference.fail.cpp
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 // UNSUPPORTED: c++98, c++03, c++11, c++14
12
13 // <variant>
14
15 // template <class ...Types> class variant;
16
17 #include <variant>
18
19 #include "test_macros.h"
20 #include "variant_test_helpers.hpp"
21
22 int main()
23 {
24     // expected-error@variant:* 3 {{static_assert failed}}
25     std::variant<int, int&> v; // expected-note {{requested here}}
26     std::variant<int, const int &> v2; // expected-note {{requested here}}
27     std::variant<int, int&&> v3; // expected-note {{requested here}}
28 }