From 325377b57338e700317f5e423e5b0f1c08d99a39 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:44 +0000 Subject: Vendor import of clang trunk r305575: https://llvm.org/svn/llvm-project/cfe/trunk@305575 --- lib/Format/UnwrappedLineParser.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Format/UnwrappedLineParser.cpp') diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index eda7ef36434d..27436dda67a7 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -492,6 +492,11 @@ void UnwrappedLineParser::parseBlock(bool MustBeDeclaration, bool AddLevel, nextToken(); Line->Level = InitialLevel; Line->MatchingOpeningBlockLineIndex = OpeningLineIndex; + if (OpeningLineIndex != UnwrappedLine::kInvalidIndex) { + // Update the opening line to add the forward reference as well + (*CurrentLines)[OpeningLineIndex].MatchingOpeningBlockLineIndex = + CurrentLines->size() - 1; + } } static bool isGoogScope(const UnwrappedLine &Line) { -- cgit v1.3