Issue 58202
Summary Running clang-format once produces different output from running it twice, on some inputs
Labels new issue
Assignees
Reporter bzbarsky-apple
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to