[libcxx-commits] [libcxx] [libc++][test] Close LWG3382 and add tests (PR #93039)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 22 07:34:31 PDT 2024
https://github.com/huixie90 created https://github.com/llvm/llvm-project/pull/93039
None
>From c47d09d3001c1088e56b080e3f31bf90e0d90bf9 Mon Sep 17 00:00:00 2001
From: Hui <hui.xie0621 at gmail.com>
Date: Wed, 22 May 2024 15:33:55 +0100
Subject: [PATCH] [libc++][test] Close LWG3382 and add tests
---
libcxx/docs/Status/Cxx20Issues.csv | 2 +-
.../sequences/array/lwg3382.compile.pass.cpp | 27 +++++++++++++++++++
.../pairs/pairs.pair/lwg3382.compile.pass.cpp | 23 ++++++++++++++++
3 files changed, 51 insertions(+), 1 deletion(-)
create mode 100644 libcxx/test/std/containers/sequences/array/lwg3382.compile.pass.cpp
create mode 100644 libcxx/test/std/utilities/utility/pairs/pairs.pair/lwg3382.compile.pass.cpp
diff --git a/libcxx/docs/Status/Cxx20Issues.csv b/libcxx/docs/Status/Cxx20Issues.csv
index db57b15256a62..93361f7703398 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -285,7 +285,7 @@
"`3379 <https://wg21.link/LWG3379>`__","""``safe``\ "" in several library names is misleading","Prague","|Complete|","15.0","|ranges|"
"`3380 <https://wg21.link/LWG3380>`__","``common_type``\ and comparison categories","Prague","|Complete|","15.0","|spaceship|"
"`3381 <https://wg21.link/LWG3381>`__","``begin``\ and ``data``\ must agree for ``contiguous_range``\ ","Prague","|Nothing To Do|","","|ranges|"
-"`3382 <https://wg21.link/LWG3382>`__","NTTP for ``pair``\ and ``array``\ ","Prague","",""
+"`3382 <https://wg21.link/LWG3382>`__","NTTP for ``pair``\ and ``array``\ ","Prague","|Nothing To Do|",""
"`3383 <https://wg21.link/LWG3383>`__","|sect|\ [time.zone.leap.nonmembers] ``sys_seconds``\ should be replaced with ``seconds``\ ","Prague","|Complete|","19.0","|chrono|"
"`3384 <https://wg21.link/LWG3384>`__","``transform_view::*sentinel*``\ has an incorrect ``operator-``\ ","Prague","|Complete|","15.0","|ranges|"
"`3385 <https://wg21.link/LWG3385>`__","``common_iterator``\ is not sufficiently constrained for non-copyable iterators","Prague","|Complete|","15.0","|ranges|"
diff --git a/libcxx/test/std/containers/sequences/array/lwg3382.compile.pass.cpp b/libcxx/test/std/containers/sequences/array/lwg3382.compile.pass.cpp
new file mode 100644
index 0000000000000..939ee513f13af
--- /dev/null
+++ b/libcxx/test/std/containers/sequences/array/lwg3382.compile.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+#include <array>
+
+#include "test_macros.h"
+
+template <auto>
+struct Test {};
+
+void test() {
+ // LWG 3382. NTTP for pair and array
+ // https://cplusplus.github.io/LWG/issue3382
+ constexpr std::array<int, 5> a{};
+ [[maybe_unused]] Test<a> test1{};
+
+ constexpr std::array<int, 0> b{};
+ [[maybe_unused]] Test<b> test2{};
+}
diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/lwg3382.compile.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/lwg3382.compile.pass.cpp
new file mode 100644
index 0000000000000..0e95120da689c
--- /dev/null
+++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/lwg3382.compile.pass.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++11, c++14, c++17
+
+#include <utility>
+
+#include "test_macros.h"
+
+template <auto>
+struct Test {};
+
+void test() {
+ // LWG 3382. NTTP for pair and array
+ // https://cplusplus.github.io/LWG/issue3382
+ constexpr std::pair<int, long> a{};
+ [[maybe_unused]] Test<a> test1{};
+}
More information about the libcxx-commits
mailing list