-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add a regression test for recent regression in pair. #97355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR llvm#96165 broke code similar to this test, and was subsequently reverted. Add a test-case, to ensure the problem won't reoccur.
@llvm/pr-subscribers-libcxx Author: James Y Knight (jyknight) ChangesPR #96165 broke code similar to this test, and was subsequently reverted. Add a test-case, to ensure the problem won't reoccur. Full diff: https://github.com/llvm/llvm-project/pull/97355.diff 1 Files Affected:
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;
|
@@ -0,0 +1,15 @@ | |||
// Check that instantiating pair doesn't look up type traits "too early", before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a license header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ comments addressed. Thanks!
// This is a regression test, to prevent a reoccurrance of the issue introduced in | ||
// 5e1de27f680591a870d78e9952b23f76aed7f456. | ||
|
||
// expected-no-diagnostics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a .compile.pass.cpp
test instead of .verify.pass.cpp
, that way it can run under all compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a reference to the possibly-related issues as suggested.
@@ -0,0 +1,15 @@ | |||
// Check that instantiating pair doesn't look up type traits "too early", before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// This is a regression test, to prevent a reoccurrance of the issue introduced in | ||
// 5e1de27f680591a870d78e9952b23f76aed7f456. | ||
|
||
// expected-no-diagnostics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
PR llvm#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 llvm#59292 and llvm#59966.
PR llvm#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 llvm#59292 and llvm#59966.
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.