diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-11-23 01:02:51 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-11-23 01:02:51 +0000 |
| commit | 80e66ac1d3cdb67a35ca0c57f8e4a00cacd0f019 (patch) | |
| tree | 370e5d119c4f7c459428f538bfdeb677ac1caaa7 /libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp | |
| parent | be6c2f1a36d8e7a720653bbb79ae494b6b68e99c (diff) | |
| download | bcm5719-llvm-80e66ac1d3cdb67a35ca0c57f8e4a00cacd0f019.tar.gz bcm5719-llvm-80e66ac1d3cdb67a35ca0c57f8e4a00cacd0f019.zip | |
Add <variant> tests but disable them for libc++
llvm-svn: 287728
Diffstat (limited to 'libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp')
| -rw-r--r-- | libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp b/libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp new file mode 100644 index 00000000000..f430a66847a --- /dev/null +++ b/libcxx/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp @@ -0,0 +1,54 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <variant> + +// constexpr bool operator<(monostate, monostate) noexcept { return false; } +// constexpr bool operator>(monostate, monostate) noexcept { return false; } +// constexpr bool operator<=(monostate, monostate) noexcept { return true; } +// constexpr bool operator>=(monostate, monostate) noexcept { return true; } +// constexpr bool operator==(monostate, monostate) noexcept { return true; } +// constexpr bool operator!=(monostate, monostate) noexcept { return false; } + +#include <cassert> +#include <type_traits> +#include <variant> + +int main() { + using M = std::monostate; + constexpr M m1{}; + constexpr M m2{}; + { + static_assert((m1 < m2) == false, ""); + static_assert(noexcept(m1 < m2), ""); + } + { + static_assert((m1 > m2) == false, ""); + static_assert(noexcept(m1 > m2), ""); + } + { + static_assert((m1 <= m2) == true, ""); + static_assert(noexcept(m1 <= m2), ""); + } + { + static_assert((m1 >= m2) == true, ""); + static_assert(noexcept(m1 >= m2), ""); + } + { + static_assert((m1 == m2) == true, ""); + static_assert(noexcept(m1 == m2), ""); + } + { + static_assert((m1 != m2) == false, ""); + static_assert(noexcept(m1 != m2), ""); + } +} |

