<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58202>58202</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Running clang-format once produces different output from running it twice, on some inputs
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bzbarsky-apple
      </td>
    </tr>
</table>

<pre>
    Consider this minimal Objective-C header:
```
#import <Foundation/Foundation.h>

@interface Foo : NSObject

/**
  */- (void)foo;

@end
```

If I run clang-format on it once, I get this diff against the original file:
```
@@ -3,6 +3,7 @@
 @interface Foo : NSObject
 
 /**
-  */- (void)foo;
+ */
+-(void)foo;
 
 @end
```

If I now run it again, I get this diff against the output of the first run:
```
@@ -4,6 +4,6 @@
 
 /**
  */
--(void)foo;
+- (void)foo;
 
 @end
```

Ideally, running clang-format would be idempotent, so that CI that runs clang-format on the tree and fails on any observed changes can work correctly.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNk1GPmzAMgH9NeLGoIBRoH3hoe0O6l03afkEAA9mFpEpCq-7Xz0B7p26t7qQoiRPbsT87lWkuxcFoJxu04HvpYJBaDkLBj-o31l6eMDxAj4LuWbJj0QuLdiyLrmMReSKHo7EeWHIozagb4aXRjJcfwqpnyber-jKvI6k92lbUCKUxZLuD77-WV-8Uecn4bhqzCDBLZUjr5mRkw_i2NYYl-3-8o24eRzvPry28gh011EroLmyNHYQHo0FOc42MH0ihQ79AaWTbguiE1G46QTBWdlITplYqfApmHdGAMCFvGcW7nzY5LMfXdL7AAW7LPYnwUxR8f9V4l8PHmvARzBewaXOe0RGqGcmnrEZ_HAlrO0uttHRO9p9RW9-oXTd31B4Sgbt0wyfJThieEPs6hwaFUpcpc8pES93dN9LZjKqBCoH-FX0Nj9pPus4QAro-vC4r2br_OnCC5C0iCN1AK6Ry06nQFzCVQ3vCBuqeTJBMhaan7BvUxlrqF3VZBVjEWZZG-TaNt0FTJM022YrAS6-w-Pko1qnd4WhNM9a4VA8txXsrW2vN8J4kldyf5fI9KChnBkpRk5oLRquK3vujm-o61aXspO_HalWbgQSlTrclpMfm7ualdG5ER5t0wyMe9EUr1nXcZljxjci4qKp4s0lzsUlxu07TJg-UqFC5gqV7xrnGM8wuaM_Sl0AW5IXHUZTFm4jyX1VRXSV52uYiSaI4zafCDoR0NcWxMrYLbDGHVI2do0slnXcfl8I52WnE-TnyL0bfG1tUfyph3dslFMejwmCOoJgz-AuZKIyI">