owenpan created this revision. owenpan added reviewers: MyDeveloperDay, HazardyKnusperkeks. owenpan added a project: clang-format. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
This patch makes characterizing top-level unwrapped lines more precise. There are no test cases to add unless we want to include invalid ones, e.g.: { int f(i) int i; { return i + 1; } } Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D109752 Files: clang/lib/Format/UnwrappedLineParser.cpp Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -431,7 +431,7 @@ } LLVM_FALLTHROUGH; default: - parseStructuralElement(/*IsTopLevel=*/true); + parseStructuralElement(!HasOpeningBrace); break; } } while (!eof());
Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -431,7 +431,7 @@ } LLVM_FALLTHROUGH; default: - parseStructuralElement(/*IsTopLevel=*/true); + parseStructuralElement(!HasOpeningBrace); break; } } while (!eof());
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits