[PATCH] D115738: [clang-format] Fix formatting of the code that follows C# Lambda Expressions

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 15 04:15:42 PST 2021


owenpan added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1870
           // C# may break after => if the next character is a newline.
           if (Style.isCSharp() && Style.BraceWrapping.AfterFunction == true) {
             // calling `addUnwrappedLine()` here causes odd parsing errors.
----------------
Let's fix this too while we are at it. In the future, we may want to factor lines 1862-1874 and 2004-2009.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2008
+          if (Style.BraceWrapping.AfterFunction)
+            FormatTok->MustBreakBefore = true;          
+          parseChildBlock();
----------------
Remove trailing whitespaces.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115738/new/

https://reviews.llvm.org/D115738



More information about the cfe-commits mailing list