1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // constexpr unspecified ignore;
17 #include <type_traits>
19 #include "test_macros.h"
21 constexpr bool test_ignore_constexpr()
24 { // Test that std::ignore provides constexpr converting assignment.
25 auto& res
= (std::ignore
= 42);
26 assert(&res
== &std::ignore
);
28 { // Test that std::ignore provides constexpr copy/move constructors
29 auto copy
= std::ignore
;
30 auto moved
= std::move(copy
);
33 { // Test that std::ignore provides constexpr copy/move assignment
34 auto copy
= std::ignore
;
36 auto moved
= std::ignore
;
37 moved
= std::move(copy
);
43 int main(int, char**) {
45 constexpr auto& ignore_v
= std::ignore
;
49 static_assert(test_ignore_constexpr(), "");
52 LIBCPP_STATIC_ASSERT(std::is_trivial
<decltype(std::ignore
)>::value
, "");