Skip to content

Commit 3e23230

Browse files
clang format + code review
1 parent 63e6099 commit 3e23230

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

clang/lib/AST/ASTImporter.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,7 @@ ExpectedDecl ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) {
40364036
// To avoid an infinite recursion when importing, create the FunctionDecl
40374037
// with a simplified return type.
40384038
if (hasReturnTypeDeclaredInside(D) ||
4039-
Importer.DeclTypeCycles.find(D) != Importer.DeclTypeCycles.end()) {
4039+
Importer.DeclTypeCycles.find(D) != Importer.DeclTypeCycles.end()) {
40404040
FromReturnTy = Importer.getFromContext().VoidTy;
40414041
UsedDifferentProtoType = true;
40424042
}
@@ -4059,13 +4059,11 @@ ExpectedDecl ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) {
40594059
}
40604060

40614061
Error Err = Error::success();
4062-
if (!UsedDifferentProtoType) {
4062+
if (!UsedDifferentProtoType)
40634063
Importer.DeclTypeCycles.insert(D);
4064-
}
40654064
auto T = importChecked(Err, FromTy);
4066-
if (!UsedDifferentProtoType) {
4065+
if (!UsedDifferentProtoType)
40674066
Importer.DeclTypeCycles.erase(D);
4068-
}
40694067
auto TInfo = importChecked(Err, FromTSI);
40704068
auto ToInnerLocStart = importChecked(Err, D->getInnerLocStart());
40714069
auto ToEndLoc = importChecked(Err, D->getEndLoc());

clang/unittests/AST/ASTImporterTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3249,7 +3249,8 @@ TEST_P(ImportExpr, CycleInAutoTemplateSpec) {
32493249
}
32503250
)";
32513251
// This test reproduces the StrCatT recursion pattern with concepts and span
3252-
// that may cause infinite recursion during AST import due to circular dependencies
3252+
// that may cause infinite recursion during AST import due to circular
3253+
// dependencies
32533254
testImport(Code, Lang_CXX20, "", Lang_CXX20, Verifier,
32543255
functionTemplateDecl(hasName("declToImport")));
32553256
}

0 commit comments

Comments
 (0)