[PATCH] D32524: [clang-format] Fix MatchingOpeningBlockLineIndex computation

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 08:29:51 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL303353: [clang-format] Fix MatchingOpeningBlockLineIndex computation (authored by krasimir).

Changed prior to commit:
  https://reviews.llvm.org/D32524?vs=99136&id=99442#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32524

Files:
  cfe/trunk/lib/Format/UnwrappedLineParser.cpp


Index: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp
@@ -429,8 +429,9 @@
     parseParens();
 
   addUnwrappedLine();
-  size_t OpeningLineIndex =
-      Lines.empty() ? (UnwrappedLine::kInvalidIndex) : (Lines.size() - 1);
+  size_t OpeningLineIndex = CurrentLines->empty()
+                                ? (UnwrappedLine::kInvalidIndex)
+                                : (CurrentLines->size() - 1);
 
   ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack,
                                           MustBeDeclaration);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32524.99442.patch
Type: text/x-patch
Size: 706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170518/8bc39b25/attachment.bin>


More information about the cfe-commits mailing list