[all-commits] [llvm/llvm-project] 37c223: [clang-format] [PR50702] Lamdba processing does no...

MyDeveloperDay via All-commits all-commits at lists.llvm.org
Sat Jun 26 05:34:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37c2233097ac44697b87228d86eef1fce10ea5c1
      https://github.com/llvm/llvm-project/commit/37c2233097ac44697b87228d86eef1fce10ea5c1
  Author: mydeveloperday <mydeveloperday at gmail.com>
  Date:   2021-06-26 (Sat, 26 Jun 2021)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] [PR50702] Lamdba processing does not respect AfterClass and AfterNamespace

https://bugs.llvm.org/show_bug.cgi?id=50702

I believe {D44609} may be too aggressive with brace wrapping rules which doesn't always apply to Lamdbas

The introduction of BeforeLambdaBody and AllowShortLambdasOnASingleLine has impact on brace handling on other block types, which I suspect we didn't see before as people may not be using the BeforeLambdaBody  style

>From what I can tell this can be seen by the unit test I change as its not honouring the orginal LLVM brace wrapping style for the `Fct()` function

I added a unit test from PR50702 and have removed some of the code (which has zero impact on the unit test, which kind of suggests its unnecessary), some additional attempt has been made to try and ensure we'll only break on what is actually a LamdbaLBrace

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D104222




More information about the All-commits mailing list