]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/experimental/type_traits/nonesuch.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / experimental / type_traits / nonesuch.cc
CommitLineData
a73d2fa8 1// 2019-05-14 Nina Dinka Ranns <dinka.ranns@gmail.com>
8d9254fc 2// Copyright (C) 2019-2020 Free Software Foundation, Inc.
a73d2fa8
NDR
3//
4// This file is part of the GNU ISO C++ Library. This library is free
5// software; you can redistribute it and/or modify it under the
6// terms of the GNU General Public License as published by the
7// Free Software Foundation; either version 3, or (at your option)
8// any later version.
9
10// This library is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14
15// You should have received a copy of the GNU General Public License along
16// with this library; see the file COPYING3. If not see
17// <http://www.gnu.org/licenses/>.
18
19// { dg-do compile { target c++14 } }
20
21#include <experimental/type_traits>
22// Example taken from LWG2960
23
24using std::experimental::nonesuch;
25
26struct such {};
27void f(const such&){};
28void f(const nonesuch&);
29
30int main(){
31 static_assert(!std::is_default_constructible<nonesuch>::value,
32 "nonesuch is default constructible");
33 static_assert(!std::is_copy_constructible<nonesuch>::value,
34 "nonesuch is copy constructible");
35 static_assert(!std::is_assignable<nonesuch,nonesuch>::value,
36 "nonesuch is assignable");
37 static_assert(!std::is_destructible<nonesuch>::value,
38 "nonesuch is destructible");
39 f({});
40}