]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/18_support/comparisons/categories/94565.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 18_support / comparisons / categories / 94565.cc
CommitLineData
99dee823 1// Copyright (C) 2020-2021 Free Software Foundation, Inc.
597601aa
JW
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-options "-std=gnu++2a" }
19// { dg-do compile { target c++2a } }
20
21#include <compare>
22
23static_assert(noexcept(std::partial_ordering::less == 0));
24static_assert(noexcept(std::partial_ordering::less != 0));
25static_assert(noexcept(std::partial_ordering::less < 0));
26static_assert(noexcept(std::partial_ordering::less > 0));
27static_assert(noexcept(std::partial_ordering::less <= 0));
28static_assert(noexcept(std::partial_ordering::less >= 0));
29static_assert(noexcept(std::partial_ordering::less <=> 0));
30static_assert(noexcept(0 == std::partial_ordering::less));
31static_assert(noexcept(0 != std::partial_ordering::less));
32static_assert(noexcept(0 < std::partial_ordering::less));
33static_assert(noexcept(0 > std::partial_ordering::less));
34static_assert(noexcept(0 <= std::partial_ordering::less));
35static_assert(noexcept(0 >= std::partial_ordering::less));
36static_assert(noexcept(0 <=> std::partial_ordering::less));
37
38static_assert(noexcept(std::weak_ordering::less == 0));
39static_assert(noexcept(std::weak_ordering::less != 0));
40static_assert(noexcept(std::weak_ordering::less < 0));
41static_assert(noexcept(std::weak_ordering::less > 0));
42static_assert(noexcept(std::weak_ordering::less <= 0));
43static_assert(noexcept(std::weak_ordering::less >= 0));
44static_assert(noexcept(std::weak_ordering::less <=> 0));
45static_assert(noexcept(0 == std::weak_ordering::less));
46static_assert(noexcept(0 != std::weak_ordering::less));
47static_assert(noexcept(0 < std::weak_ordering::less));
48static_assert(noexcept(0 > std::weak_ordering::less));
49static_assert(noexcept(0 <= std::weak_ordering::less));
50static_assert(noexcept(0 >= std::weak_ordering::less));
51static_assert(noexcept(0 <=> std::weak_ordering::less));
52
53static_assert(noexcept(std::strong_ordering::less == 0));
54static_assert(noexcept(std::strong_ordering::less != 0));
55static_assert(noexcept(std::strong_ordering::less < 0));
56static_assert(noexcept(std::strong_ordering::less > 0));
57static_assert(noexcept(std::strong_ordering::less <= 0));
58static_assert(noexcept(std::strong_ordering::less >= 0));
59static_assert(noexcept(std::strong_ordering::less <=> 0));
60static_assert(noexcept(0 == std::strong_ordering::less));
61static_assert(noexcept(0 != std::strong_ordering::less));
62static_assert(noexcept(0 < std::strong_ordering::less));
63static_assert(noexcept(0 > std::strong_ordering::less));
64static_assert(noexcept(0 <= std::strong_ordering::less));
65static_assert(noexcept(0 >= std::strong_ordering::less));
66static_assert(noexcept(0 <=> std::strong_ordering::less));