Issue 124737
Summary [clang-format] AllowShortLambdasOnASingleLine and ColumnLimit seem to not work right together
Labels clang-format
Assignees
Reporter etodanik
    ```
---
AllowShortLambdasOnASingleLine: All
BasedOnStyle: LLVM
ColumnLimit: 0
```

This short config fails to format this snippet (shortened from real life code):
```cpp
void USageFleetSpawnDataGenerator::Generate(UObject& QueryOwner, FSageSpawnedEntityType EntityType, FSageFinishedGeneratingSpawnDataSignature& FinishedGeneratingSpawnPointsDelegate) const
{
	Launch(UE_SOURCE_LOCATION, [this, FleetDataProviderTask, ShipDataProviderTask, ResolveMeshesTask, FinishedGeneratingSpawnPointsDelegate = MoveTemp(FinishedGeneratingSpawnPointsDelegate), World]() mutable {
			for (const auto& Row : FleetsOverviewAggregate)
			{
			
				Result.NumEntities += 1 ;}   

			AddNested(Launch(UE_SOURCE_LOCATION, [FinishedGeneratingSpawnPointsDelegate = MoveTemp(FinishedGeneratingSpawnPointsDelegate), Result = MoveTemp(Result)]() { FinishedGeneratingSpawnPointsDelegate.Execute(Result); }, 
			ETaskPriority::Default, EExtendedTaskPriority::GameThreadNormalPri)); }, Prerequisites(ResolveMeshesTask), ETaskPriority::BackgroundNormal);
}
```

Setting `ColumnLimit` to anything but `0` works but limits the ability to decide when to wrap some things. Conversely, not allowing short lambdas also seems to fix things, but again, limits the formatting to be a bit too rigid. 

Interestingly, adjusting `BraceWrapping` to always wrap `BeforeLambdaBody` also interacts weirdly here... 

It seems that `AllowShortLambdasOnASingleLine` is the source of trouble here, though.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to