Skip to content

Commit cfbad45

Browse files
authored
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.
1 parent 43b9888 commit cfbad45

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
// Check that instantiating pair doesn't look up type traits "too early", before
10+
// the contained types have been completed.
11+
//
12+
// This is a regression test, to prevent a reoccurrance of the issue introduced
13+
// in 5e1de27f680591a870d78e9952b23f76aed7f456.
14+
15+
#include <utility>
16+
#include <vector>
17+
18+
struct Test {
19+
std::vector<std::pair<int, Test> > v;
20+
};
21+
22+
std::pair<int, Test> p;

0 commit comments

Comments
 (0)