Skip to content

Commit f13e131

Browse files
authored
Merge pull request #65165 from xedin/record-pack-expansion-envs
[CSSolver] Add recorded pack expansion environments to solutions
2 parents 54f18b0 + fdca265 commit f13e131

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ Solution ConstraintSystem::finalize() {
213213
solution.ImplicitCallAsFunctionRoots.insert(implicitRoot);
214214
}
215215

216+
for (const auto &env : PackExpansionEnvironments) {
217+
solution.PackExpansionEnvironments.insert(env);
218+
}
219+
216220
return solution;
217221
}
218222

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,16 @@ void ConstraintSystem::print(raw_ostream &out) const {
15781578
}
15791579
}
15801580

1581+
if (!PackExpansionEnvironments.empty()) {
1582+
out.indent(indent) << "Pack Expansion Environments:\n";
1583+
for (const auto &env : PackExpansionEnvironments) {
1584+
out.indent(indent + 2);
1585+
env.first->dump(&getASTContext().SourceMgr, out);
1586+
out << " = (" << env.second.first << ", "
1587+
<< env.second.second->getString(PO) << ")" << '\n';
1588+
}
1589+
}
1590+
15811591
if (!DefaultedConstraints.empty()) {
15821592
out.indent(indent) << "Defaulted constraints:\n";
15831593
interleave(DefaultedConstraints, [&](ConstraintLocator *locator) {

0 commit comments

Comments
 (0)