[libcxx-commits] [libcxx] [libc++][tuple][utility] P2968R2 Make `std::ignore` a first-class object (PR #97401)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 7 04:40:52 PDT 2024
================
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03
+
+// <tuple>
+
+// inline constexpr ignore-type ignore;
+
+#include <tuple>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ { [[maybe_unused]] TEST_CONSTEXPR_CXX14 auto& ignore_v = std::ignore; }
+}
----------------
mordante wrote:
Since it's a compile-time test we don't need main.
I like to avoid adding other headers; that way we're sure no other Standard headers are included. That way we can verify <tuple> provides `std::ignore`.
```suggestion
[[maybe_unused]] auto& ignore_v = std::ignore; }
```
https://github.com/llvm/llvm-project/pull/97401
More information about the libcxx-commits
mailing list