[libcxx-commits] [libcxx] cfbad45 - Add a regression test for recent regression in pair. (#97355)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 2 08:20:41 PDT 2024
Author: James Y Knight
Date: 2024-07-02T11:20:37-04:00
New Revision: cfbad45339edb4a512982d9180e6fd4bae781d8a
URL: https://github.com/llvm/llvm-project/commit/cfbad45339edb4a512982d9180e6fd4bae781d8a
DIFF: https://github.com/llvm/llvm-project/commit/cfbad45339edb4a512982d9180e6fd4bae781d8a.diff
LOG: Add a regression test for recent regression in pair. (#97355)
PR #96165 broke code similar to this test, and was subsequently
reverted. Add a test-case, to ensure the problem won't reoccur.
This error is potentially related to issues #59292 and #59966.
Added:
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp
Modified:
Removed:
################################################################################
diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp
new file mode 100644
index 0000000000000..16ee000cd90fa
--- /dev/null
+++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// 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.
+
+#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