[libcxx-commits] [libcxx] Add a regression test for recent regression in pair. (PR #97355)
James Y Knight via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 1 14:49:32 PDT 2024
https://github.com/jyknight created https://github.com/llvm/llvm-project/pull/97355
PR #96165 broke code similar to this test, and was subsequently reverted. Add a test-case, to ensure the problem won't reoccur.
>From 832d98196ddd7902311fb12b85667543ca26e537 Mon Sep 17 00:00:00 2001
From: James Y Knight <jyknight at google.com>
Date: Mon, 1 Jul 2024 17:32:11 -0400
Subject: [PATCH] Add a regression test for recent regression in pair.
PR #96165 broke code similar to this test, and was subsequently
reverted. Add a test-case, to ensure the problem won't reoccur.
---
.../pairs/pairs.pair/pair.incomplete.verify.cpp | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.verify.cpp
diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.verify.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.verify.cpp
new file mode 100644
index 0000000000000..d0832ea311690
--- /dev/null
+++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.verify.cpp
@@ -0,0 +1,15 @@
+// Check that instantiating pair doesn't look up type traits "too early", before
+// the contained types have been completed.
+//
+// This is a regression test, to prevent a reoccurrance of the issue introduced in
+// 5e1de27f680591a870d78e9952b23f76aed7f456.
+
+// expected-no-diagnostics
+#include <utility>
+#include <vector>
+
+struct Test {
+ std::vector<std::pair<int, Test>> v;
+};
+
+std::pair<int, Test> p;
More information about the libcxx-commits
mailing list