Skip to content

Commit 9520c14

Browse files
committed
[cxx-interop] Avoid cycles in ClangDeclExplicitSafety requests
1 parent d2632d2 commit 9520c14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8709,9 +8709,11 @@ ExplicitSafety ClangTypeExplicitSafety::evaluate(
87098709
if (auto recordDecl = clangType->getAsTagDecl()) {
87108710
// If we reached this point the types is not imported as a shared reference,
87118711
// so we don't need to check the bases whether they are shared references.
8712-
return evaluateOrDefault(evaluator,
8713-
ClangDeclExplicitSafety({recordDecl, false}),
8714-
ExplicitSafety::Unspecified);
8712+
auto req = ClangDeclExplicitSafety({recordDecl, false});
8713+
if (evaluator.hasActiveRequest(req))
8714+
// Cycles are allowed in template arguments, so avoid them here.
8715+
return ExplicitSafety::Unspecified;
8716+
return evaluateOrDefault(evaluator, req, ExplicitSafety::Unspecified);
87158717
}
87168718

87178719
// Everything else is safe.

0 commit comments

Comments
 (0)