]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/experimental/net/internet/resolver/base.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / experimental / net / internet / resolver / base.cc
1 // Copyright (C) 2015-2024 Free Software Foundation, Inc.
2 //
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
7 // any later version.
8
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
17
18 // { dg-do compile { target c++14 } }
19 // { dg-require-effective-target net_ts_ip }
20 // { dg-add-options net_ts }
21
22 #include <experimental/internet>
23 #include <testsuite_common_types.h>
24 #include <testsuite_hooks.h>
25
26 using std::experimental::net::ip::resolver_base;
27
28 static_assert( __gnu_test::test_bitmask_values({
29 resolver_base::passive,
30 resolver_base::canonical_name,
31 resolver_base::numeric_host,
32 #ifdef AI_NUMERICSERV
33 resolver_base::numeric_service,
34 #endif
35 #ifdef AI_V4MAPPED
36 resolver_base::v4_mapped,
37 #endif
38 #ifdef AI_ALL
39 resolver_base::all_matching,
40 #endif
41 #ifdef AI_ADDRCONFIG
42 resolver_base::address_configured
43 #endif
44 }), "each bitmask element is distinct" );
45
46 static_assert( ! std::is_default_constructible<resolver_base>(), "protected" );
47 static_assert( ! std::is_destructible<resolver_base>(), "protected" );
48
49 struct Res : resolver_base { };
50 static_assert( std::is_default_constructible<Res>(), "" );
51 static_assert( std::is_destructible<Res>(), "" );