Issue 171841
Summary [clang-format] Java synchronized block in lambda breaks indentation
Labels clang-format, java
Assignees
Reporter LordMZTE
    Consider the following syntactically correct Java code:
```java
class Test {
  void foo() {
    () -> {
      synchronized {
        x;
      }
    };
 y;
  }
}
```
When formatted with clang-format, version `21.1.2` and no custom configuration, we get:
```java
class Test {
  void foo() { () -> {synchronized{x; }
};
y;
}
}
```
Note that, aside from the arbitrary-looking brace placement, the `y;` statement inside the function body as well as following braces are also at the incorrect indentation level.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to