Issue 124235
Summary [clang-format] 'MultiLine' for 'AfterControlStatement' not working correctly
Labels clang-format
Assignees
Reporter zenixx1337
    clang-format version: 19.1.0

'MultiLine' for 'AfterControlStatement' not working correctly

AllowShortBlocksOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: true
**AfterControlStatement: MultiLine**
```cpp
    // good
    while ( true )
    {
        return 1;
    }

    // good
    while ( true ) {
        return 1;
    }

 // wrong, tried in a single line: while ( true ) { return 1 }
    while ( true ) {
        return 1;
    }

    // wrong, tried in a single line: if ( true ) { return 1; }
    if ( true ) {
        return 1;
 }
```

AllowShortBlocksOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: true
**AfterControlStatement: Always**
```cpp
    // good
    while ( true )
    {
        return 1;
 }

    // good
    while ( true )
    {
        return 1;
    }

 // good
    while ( true ) { return 1; }

    // good
    if ( true ) { return 1; }
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to